TAILIEUCHUNG - Programming Visual Basic 2008 phần 6

Và sử dụng các loại của nó trong mã của bạn.) Trước khi sử dụng chúng trong mã, chúng ta cần phải tạo ra tài liệu tham khảo cho họ. Điều này được thực hiện thông qua các cửa sổ tài sản dự án, trên tab Tài liệu tham khảo. Bạn sẽ thấy một danh sách của những hội đồng đã được tham chiếu bởi ứng dụng (xem hình 10-9). | Dim attrData As XmlAttribute attrData ID 652 attrData So this is nice and all but what if you already have some XML in a file and you just want to load it into an XmlDocument object Simply use the XmlDocument object s Load method. Dim products As XmlDocument products New XmlDocument c For those instances where you just want to read or write some XML from or to a file and you don t care much about manipulating it in memory the XmlTextReader and XmlTextWriter classes let you quickly read and write XML data via a text stream. But if you are going to do things with the XML data in your program the Load and Save methods of the XmlDocument object are a better choice. Finding Needles and Haystacks In our sample data all of the products appear in supplier groups. If we just want a list of products regardless of supplier we ask the XmlDocument object to supply that data via an XmlNodeList object. Dim justProducts As XmlNodeList Dim oneProduct As XmlNode ----First get the list. justProducts product ---- Then do something with them. For Each oneProduct In justProducts ----- Put interesting code here. Next oneProduct MsgBox Processed _ product s . For a more complex selection of nodes within the document the namespace implements the XPath searching language which gives you increased flexibility in locating items. The Visual Studio documentation describes the methods and searching syntax used with these classes. Schema Verification An XmlDocument object can hold any type of random yet valid XML content but you can also verify the document against an XSD schema. If your XML document refers to an XSD schema includes a DTD or uses XDR XML Data Reduced schemas similar to XSD an XmlReader when configured with the appropriate XmlReaderSettings will properly compare your XML data against the defined rules and throw an .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.