Using an XmlDocument Object to Store an XML Document
Số trang: 8
Loại file: pdf
Dung lượng: 39.50 KB
Lượt xem: 6
Lượt tải: 0
Xem trước 2 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Bạn sử dụng một đối tượng của lớp XmlDocument để đại diện cho một tài liệu XML trong một chương trình C #. Một đối tượng XmlDocument cửa hàng các nút của các tài liệu XML trong các đối tượng của lớp XmlNode. Bạn có thể, ví dụ, dòng tải từ cơ sở dữ liệu vào một đối tượng DataSet, và sau đó tải một đại diện XML của những người hàng vào một đối tượng XmlDocument. Bảng 16,5 cho thấy một số tài sản XmlDocument...
Nội dung trích xuất từ tài liệu:
Using an XmlDocument Object to Store an XML Document Using an XmlDocument Object to Store an XML DocumentYou use an object of the XmlDocument class to represent an XML document in a C#program. An XmlDocument object stores the nodes of the XML document in objects ofthe XmlNode class. You can, for example, load rows from the database into a DataSetobject, and then load an XML representation of those rows into an XmlDocument object.Table 16.5 shows some of the XmlDocument properties; Table 16.6 shows some of theXmlDocument methods; and Table 16.7 shows the XmlDocument events. Table 16.5: XmlDocument PropertiesProperty Type DescriptionAttributes XmlAttributeCollection Gets the XmlAttributeCollection object that contains the attributes of the current node.BaseURI string Gets the base URI of the current node.ChildNodes XmlNodeList Gets all the child nodes of the node.DocumentElement XmlElement Gets the root XmlElement object for the XML document.DocumentType XmlDocumentType Gets the node containing the DOCTYPE declaration.FirstChild XmlNode Gets the first child of the node.HasChildNodes bool Gets a bool that indicates whether this node has any child nodes.Implementation XmlImplementation Gets the XmlImplementation object for the XML document.InnerText string Gets or sets the concatenated values of the node and all of its children.InnerXml string Gets or sets the XML that represents the children of the current node.IsReadOnly bool Gets a bool value that indicates whether the current node is read-only.LastChild XmlNode Gets the last child of the node.LocalName string Gets the local name of the node.Name string Gets the qualified name of the node.NamespaceURI string Gets the namespace URI of the node.NameTable XmlNameTable Gets the XmlNameTable object associated Table 16.5: XmlDocument PropertiesProperty Type Description with the XML implementation.NextSibling XmlNode Gets the node immediately following the current node.NodeType XmlNodeType Gets the type of the current node.OuterXml string Gets the XML that represents the current node and all of its children.OwnerDocument XmlDocument Gets the XmlDocument object that the current node belongs to.ParentNode XmlNode Gets the parent of the current node.Prefix string Gets or sets the namespace prefix of the current node.PreserveWhitespace bool Gets or sets a bool value that indicates whether white space is to be preserved when XML is loaded or saved. The default is false.PreviousSibling XmlNode Gets the node immediately preceding the current node.Value string Gets or sets the value of the current node.XmlResolver XmlResolver Sets the XmlResolver object to use for resolving external resources. Table 16.6: XmlDocument MethodsMethod Return Type DescriptionAppendChild() XmlNode Adds the specified node to the end of child nodes.CloneNode() XmlNode Creates a duplicate of the node.CreateAttribute() XmlAttribute Creates an XmlAttribute object of the specified name.CreateCDataSection() XmlCDataSection Creates an XmlCDataSection object with the specified data.CreateComment() XmlComment Creates an XmlComment object with the specified data.CreateDocumentFragment() XmlDocumentFragment Creates an XmlDocumentFragment object with the specified data. Table 16.6: XmlDocument MethodsMethod Return Type DescriptionCreateDocumentType() XmlDocumentType Creates a new XmlDocumentType object with the specified data.CreateElement() XmlElement Overloaded. Creates an XmlElement object.CreateEntityReference() XmlEntityReference Creates an XmlEntityReference object with the specified name.CreateNavigator() XpathNavigator Creates an XpathNavigator object that you can use to navigate the XML document.CreateNode() XmlNode Overloaded. Creates an XmlNode ...
Nội dung trích xuất từ tài liệu:
Using an XmlDocument Object to Store an XML Document Using an XmlDocument Object to Store an XML DocumentYou use an object of the XmlDocument class to represent an XML document in a C#program. An XmlDocument object stores the nodes of the XML document in objects ofthe XmlNode class. You can, for example, load rows from the database into a DataSetobject, and then load an XML representation of those rows into an XmlDocument object.Table 16.5 shows some of the XmlDocument properties; Table 16.6 shows some of theXmlDocument methods; and Table 16.7 shows the XmlDocument events. Table 16.5: XmlDocument PropertiesProperty Type DescriptionAttributes XmlAttributeCollection Gets the XmlAttributeCollection object that contains the attributes of the current node.BaseURI string Gets the base URI of the current node.ChildNodes XmlNodeList Gets all the child nodes of the node.DocumentElement XmlElement Gets the root XmlElement object for the XML document.DocumentType XmlDocumentType Gets the node containing the DOCTYPE declaration.FirstChild XmlNode Gets the first child of the node.HasChildNodes bool Gets a bool that indicates whether this node has any child nodes.Implementation XmlImplementation Gets the XmlImplementation object for the XML document.InnerText string Gets or sets the concatenated values of the node and all of its children.InnerXml string Gets or sets the XML that represents the children of the current node.IsReadOnly bool Gets a bool value that indicates whether the current node is read-only.LastChild XmlNode Gets the last child of the node.LocalName string Gets the local name of the node.Name string Gets the qualified name of the node.NamespaceURI string Gets the namespace URI of the node.NameTable XmlNameTable Gets the XmlNameTable object associated Table 16.5: XmlDocument PropertiesProperty Type Description with the XML implementation.NextSibling XmlNode Gets the node immediately following the current node.NodeType XmlNodeType Gets the type of the current node.OuterXml string Gets the XML that represents the current node and all of its children.OwnerDocument XmlDocument Gets the XmlDocument object that the current node belongs to.ParentNode XmlNode Gets the parent of the current node.Prefix string Gets or sets the namespace prefix of the current node.PreserveWhitespace bool Gets or sets a bool value that indicates whether white space is to be preserved when XML is loaded or saved. The default is false.PreviousSibling XmlNode Gets the node immediately preceding the current node.Value string Gets or sets the value of the current node.XmlResolver XmlResolver Sets the XmlResolver object to use for resolving external resources. Table 16.6: XmlDocument MethodsMethod Return Type DescriptionAppendChild() XmlNode Adds the specified node to the end of child nodes.CloneNode() XmlNode Creates a duplicate of the node.CreateAttribute() XmlAttribute Creates an XmlAttribute object of the specified name.CreateCDataSection() XmlCDataSection Creates an XmlCDataSection object with the specified data.CreateComment() XmlComment Creates an XmlComment object with the specified data.CreateDocumentFragment() XmlDocumentFragment Creates an XmlDocumentFragment object with the specified data. Table 16.6: XmlDocument MethodsMethod Return Type DescriptionCreateDocumentType() XmlDocumentType Creates a new XmlDocumentType object with the specified data.CreateElement() XmlElement Overloaded. Creates an XmlElement object.CreateEntityReference() XmlEntityReference Creates an XmlEntityReference object with the specified name.CreateNavigator() XpathNavigator Creates an XpathNavigator object that you can use to navigate the XML document.CreateNode() XmlNode Overloaded. Creates an XmlNode ...
Tìm kiếm theo từ khóa liên quan:
máy tính mạng máy tính internet phần mềm ứng dụng lập trình SQL HTML sever web XMLTài liệu có liên quan:
-
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 2
102 trang 297 0 0 -
Giáo án Tin học lớp 9 (Trọn bộ cả năm)
149 trang 297 0 0 -
Bài giảng: Lịch sử phát triển hệ thống mạng
118 trang 281 0 0 -
Ngân hàng câu hỏi trắc nghiệm môn mạng máy tính
99 trang 278 1 0 -
47 trang 250 4 0
-
Đề cương chi tiết học phần Thiết kế và cài đặt mạng
3 trang 246 0 0 -
80 trang 238 0 0
-
6 trang 229 0 0
-
Giáo trình môn học/mô đun: Mạng máy tính (Ngành/nghề: Quản trị mạng máy tính) - Phần 1
68 trang 226 0 0 -
Giáo trình Hệ thống mạng máy tính CCNA (Tập 4): Phần 1
122 trang 223 0 0