Represents the top level of the XML source. This class includes members for retrieving and creating all other XML objects.
Syntax
var xmlDocument = new Windows.Data.Xml.Dom.XmlDocument();
Attributes
- ActivatableAttribute(NTDDI_WIN8)
- MarshalingBehaviorAttribute(Agile)
- MuseAttribute()
- StaticAttribute(Windows.Data.Xml.Dom.IXmlDocumentStatics, NTDDI_WIN8)
- ThreadingAttribute(Both)
- VersionAttribute(NTDDI_WIN8)
Members
The XmlDocument class has these types of members:
Constructors
The XmlDocument class has these constructors.
| Constructor | Description |
|---|---|
| XmlDocument | Creates a new instance of the XmlDocument class. |
Methods
The XmlDocument class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| AppendChild | Appends a new child node as the last child of the node. |
| CloneNode | Clones a new node. This method is not applicable to this class. |
| CreateAttribute | Creates a new attribute with the specified name. |
| CreateAttributeNS | Creates a new attribute with the specified namespace and name. |
| CreateCDataSection | Creates a CDATA section node that contains the supplied data. |
| CreateComment | Creates a comment node that contains the supplied data. |
| CreateDocumentFragment | Creates an empty XmlDocumentFragment object. |
| CreateElement | Creates an element node using the specified name. |
| CreateElementNS | Creates an element node using the specified namespace and name. |
| CreateEntityReference | Creates a new XmlEntityReference object. |
| CreateProcessingInstruction | Creates a processing instruction node that contains the supplied target and data. |
| CreateTextNode | Creates a text node that contains the supplied data. |
| GetElementById | Returns the element that matches the ID attribute. |
| GetElementsByTagName | Returns a collection of elements that have the specified name. |
| GetXml | Returns the XML representation of the node and all its descendants. |
| HasChildNodes | Determines whether a node has children. |
| ImportNode | Imports a node from another document to this document. |
| InsertBefore | Inserts a child node to the left of the specified node, or at the end of the child node list. |
| LoadFromFileAsync(IStorageFile) | Asynchronously loads an XML document from the specified file. The document is parsed using the default parser settings. |
| LoadFromFileAsync(IStorageFile, XmlLoadSettings) | Asynchronously loads an XML document from the specified file. The document is parsed using the provided settings. |
| LoadFromUriAsync(Uri) | Asynchronously loads an XML document from the specified location. The document is parsed using the default parser settings. |
| LoadFromUriAsync(Uri, XmlLoadSettings) | Asynchronously loads an XML document from the specified location. The document is parsed using the provided settings. |
| LoadXml(String) | Loads an XML document using the supplied string. The document is parsed using the default parser settings. |
| LoadXml(String, XmlLoadSettings) | Loads an XML document using the supplied string. The document is parsed using the settings provided. |
| Normalize | Normalizes all descendant elements by combining two or more adjacent text nodes into one unified text node. |
| RemoveChild | Removes the specified child node from the list of children and returns it. |
| ReplaceChild | Replaces the specified old child node with the supplied new child node. |
| SaveToFileAsync | Asynchronously saves an XML document to the specified file. |
| SelectNodes | Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList. |
| SelectNodesNS | Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList. |
| SelectSingleNode | Applies the specified pattern-matching operation to this node's context and returns the first matching node. |
| SelectSingleNodeNS | Applies the specified pattern-matching operation to this node's context and returns the first matching node. |
Properties
The XmlDocument class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the list of attributes of this node. | |
| Read-only | Gets a list of children in the current node. | |
| Read-only | For XML, this property gets the address of the node that specifies the DTD. This property returns Null for for HTML documents and XML documents without a DTD. | |
| Read-only | Gets the root element of the document. | |
| Read-only | Returns the URL for the last loaded XML document. | |
| Read-only | Gets the first child node. | |
| Read-only | Gets the Implementation object for the document. | |
| Read/write | Gets the text from inside the XML. | |
| Read-only | Gets the last child node. | |
| Read-only | Gets the local name, which is the local part of a qualified name. This is called the local part in Namespaces in XML. | |
| Read-only | Returns the Uniform Resource Identifier (URI) for the namespace. | |
| Read-only | Gets the next sibling of the node in the parent's child list. This property is not applicable to this class. | |
| Read-only | Returns the qualified name for attribute, document type, element, entity, or notation nodes. Returns a fixed string for all other node types. | |
| Read-only | Gets the XML Document Object Model (DOM) node type, which determines valid values and whether the node can have child nodes. | |
| Read/write | Gets or sets the text associated with the node. | |
| Read-only | Returns the root of the document that contains the node. | |
| Read-only | Gets the parent node of the node instance. | |
| Read/write | Gets or sets the namespace prefix. | |
| Read-only | Gets the previous sibling of the node in the parent's child list. This property is not applicable to this class. |
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps only] |
|
Namespace |
|
|
Metadata |
|
Build date: 12/4/2012