XmlDocument XmlDocument XmlDocument XmlDocument XmlDocument Class

Definition

Represents the top level of the XML source. This class includes members for retrieving and creating all other XML objects.

public : sealed class XmlDocument : IXmlDocument, IXmlDocumentIO, IXmlDocumentIO2, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
struct winrt::Windows::Data::Xml::Dom::XmlDocument : IXmlDocument, IXmlDocumentIO, IXmlDocumentIO2, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
public sealed class XmlDocument : IXmlDocument, IXmlDocumentIO, IXmlDocumentIO2, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
Public NotInheritable Class XmlDocument Implements IXmlDocument, IXmlDocumentIO, IXmlDocumentIO2, IXmlNode, IXmlNodeSelector, IXmlNodeSerializer
var xmlDocument = new xmlDocument();
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Constructors

XmlDocument() XmlDocument() XmlDocument() XmlDocument() XmlDocument()

Creates a new instance of the XmlDocument class.

Properties

Attributes Attributes Attributes Attributes Attributes

Gets the list of attributes of this node.

ChildNodes ChildNodes ChildNodes ChildNodes ChildNodes

Gets a list of children in the current node.

Doctype Doctype Doctype Doctype Doctype

For XML, this property gets the address of the node that specifies the DTD. This property returns Null for HTML documents and XML documents without a DTD.

DocumentElement DocumentElement DocumentElement DocumentElement DocumentElement

Gets the root element of the document.

DocumentUri DocumentUri DocumentUri DocumentUri DocumentUri

Returns the URL for the last loaded XML document.

FirstChild FirstChild FirstChild FirstChild FirstChild

Gets the first child node.

Implementation Implementation Implementation Implementation Implementation

Gets the Implementation object for the document.

InnerText InnerText InnerText InnerText InnerText

Gets the text from inside the XML.

LastChild LastChild LastChild LastChild LastChild

Gets the last child node.

LocalName LocalName LocalName LocalName LocalName

Gets the local name, which is the local part of a qualified name. This is called the local part in Namespaces in XML.

NamespaceUri NamespaceUri NamespaceUri NamespaceUri NamespaceUri

Returns the Uniform Resource Identifier (URI) for the namespace.

NextSibling NextSibling NextSibling NextSibling NextSibling

Gets the next sibling of the node in the parent's child list. This property is not applicable to this class.

NodeName NodeName NodeName NodeName NodeName

Returns the qualified name for attribute, document type, element, entity, or notation nodes. Returns a fixed string for all other node types.

NodeType NodeType NodeType NodeType NodeType

Gets the XML Document Object Model (DOM) node type, which determines valid values and whether the node can have child nodes.

NodeValue NodeValue NodeValue NodeValue NodeValue

Gets or sets the text associated with the node.

OwnerDocument OwnerDocument OwnerDocument OwnerDocument OwnerDocument

Returns the root of the document that contains the node.

ParentNode ParentNode ParentNode ParentNode ParentNode

Gets the parent node of the node instance.

Prefix Prefix Prefix Prefix Prefix

Gets or sets the namespace prefix.

PreviousSibling PreviousSibling PreviousSibling PreviousSibling PreviousSibling

Gets the previous sibling of the node in the parent's child list. This property is not applicable to this class.

Methods

AppendChild(IXmlNode) AppendChild(IXmlNode) AppendChild(IXmlNode) AppendChild(IXmlNode) AppendChild(IXmlNode)

Appends a new child node as the last child of the node.

CloneNode(Boolean) CloneNode(Boolean) CloneNode(Boolean) CloneNode(Boolean) CloneNode(Boolean)

Clones a new node.

CreateAttribute(String) CreateAttribute(String) CreateAttribute(String) CreateAttribute(String) CreateAttribute(String)

Creates a new attribute with the specified name.

CreateAttributeNS(Object, String) CreateAttributeNS(Object, String) CreateAttributeNS(Object, String) CreateAttributeNS(Object, String) CreateAttributeNS(Object, String)

Creates a new attribute with the specified namespace and name.

CreateCDataSection(String) CreateCDataSection(String) CreateCDataSection(String) CreateCDataSection(String) CreateCDataSection(String)

Creates a CDATA section node that contains the supplied data.

CreateComment(String) CreateComment(String) CreateComment(String) CreateComment(String) CreateComment(String)

Creates a comment node that contains the supplied data.

CreateDocumentFragment() CreateDocumentFragment() CreateDocumentFragment() CreateDocumentFragment() CreateDocumentFragment()

Creates an empty XmlDocumentFragment object.

CreateElement(String) CreateElement(String) CreateElement(String) CreateElement(String) CreateElement(String)

Creates an element node using the specified name.

CreateElementNS(Object, String) CreateElementNS(Object, String) CreateElementNS(Object, String) CreateElementNS(Object, String) CreateElementNS(Object, String)

Creates an element node using the specified namespace and name.

CreateEntityReference(String) CreateEntityReference(String) CreateEntityReference(String) CreateEntityReference(String) CreateEntityReference(String)

Creates a new XmlEntityReference object.

CreateProcessingInstruction(String, String) CreateProcessingInstruction(String, String) CreateProcessingInstruction(String, String) CreateProcessingInstruction(String, String) CreateProcessingInstruction(String, String)

Creates a processing instruction node that contains the supplied target and data.

CreateTextNode(String) CreateTextNode(String) CreateTextNode(String) CreateTextNode(String) CreateTextNode(String)

Creates a text node that contains the supplied data.

GetElementById(String) GetElementById(String) GetElementById(String) GetElementById(String) GetElementById(String)

Returns the element that matches the ID attribute.

GetElementsByTagName(String) GetElementsByTagName(String) GetElementsByTagName(String) GetElementsByTagName(String) GetElementsByTagName(String)

Returns a collection of elements that have the specified name.

GetXml() GetXml() GetXml() GetXml() GetXml()

Returns the XML representation of the node and all its descendants.

HasChildNodes() HasChildNodes() HasChildNodes() HasChildNodes() HasChildNodes()

Determines whether a node has children.

ImportNode(IXmlNode, Boolean) ImportNode(IXmlNode, Boolean) ImportNode(IXmlNode, Boolean) ImportNode(IXmlNode, Boolean) ImportNode(IXmlNode, Boolean)

Imports a node from another document to this document.

InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode) InsertBefore(IXmlNode, IXmlNode)

Inserts a child node to the left of the specified node, or at the end of the child node list.

LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile) LoadFromFileAsync(IStorageFile)

Asynchronously loads an XML document from the specified file. The document is parsed using the default parser settings.

LoadFromFileAsync(IStorageFile, XmlLoadSettings) LoadFromFileAsync(IStorageFile, XmlLoadSettings) LoadFromFileAsync(IStorageFile, XmlLoadSettings) LoadFromFileAsync(IStorageFile, XmlLoadSettings) LoadFromFileAsync(IStorageFile, XmlLoadSettings)

Asynchronously loads an XML document from the specified file. The document is parsed using the provided settings.

LoadFromUriAsync(Uri) LoadFromUriAsync(Uri) LoadFromUriAsync(Uri) LoadFromUriAsync(Uri) LoadFromUriAsync(Uri)

Asynchronously loads an XML document from the specified location. The document is parsed using the default parser settings.

LoadFromUriAsync(Uri, XmlLoadSettings) LoadFromUriAsync(Uri, XmlLoadSettings) LoadFromUriAsync(Uri, XmlLoadSettings) LoadFromUriAsync(Uri, XmlLoadSettings) LoadFromUriAsync(Uri, XmlLoadSettings)

Asynchronously loads an XML document from the specified location. The document is parsed using the provided settings.

LoadXml(String) LoadXml(String) LoadXml(String) LoadXml(String) LoadXml(String)

Loads an XML document using the supplied string. The document is parsed using the default parser settings.

LoadXml(String, XmlLoadSettings) LoadXml(String, XmlLoadSettings) LoadXml(String, XmlLoadSettings) LoadXml(String, XmlLoadSettings) LoadXml(String, XmlLoadSettings)

Loads an XML document using the supplied string. The document is parsed using the settings provided.

LoadXmlFromBuffer(IBuffer) LoadXmlFromBuffer(IBuffer) LoadXmlFromBuffer(IBuffer) LoadXmlFromBuffer(IBuffer) LoadXmlFromBuffer(IBuffer)

Loads an XML document using the buffer. The document is parsed using the default parser settings.

LoadXmlFromBuffer(IBuffer, XmlLoadSettings) LoadXmlFromBuffer(IBuffer, XmlLoadSettings) LoadXmlFromBuffer(IBuffer, XmlLoadSettings) LoadXmlFromBuffer(IBuffer, XmlLoadSettings) LoadXmlFromBuffer(IBuffer, XmlLoadSettings)

Loads an XML document using the buffer. The document is parsed using the settings provided.

Normalize() Normalize() Normalize() Normalize() Normalize()

Normalizes all descendant elements by combining two or more adjacent text nodes into one unified text node.

RemoveChild(IXmlNode) RemoveChild(IXmlNode) RemoveChild(IXmlNode) RemoveChild(IXmlNode) RemoveChild(IXmlNode)

Removes the specified child node from the list of children and returns it.

ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode) ReplaceChild(IXmlNode, IXmlNode)

Replaces the specified old child node with the supplied new child node.

SaveToFileAsync(IStorageFile) SaveToFileAsync(IStorageFile) SaveToFileAsync(IStorageFile) SaveToFileAsync(IStorageFile) SaveToFileAsync(IStorageFile)

Asynchronously saves an XML document to the specified file.

SelectNodes(String) SelectNodes(String) SelectNodes(String) SelectNodes(String) SelectNodes(String)

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList.

SelectNodesNS(String, Object) SelectNodesNS(String, Object) SelectNodesNS(String, Object) SelectNodesNS(String, Object) SelectNodesNS(String, Object)

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes as an XmlNodeList.

SelectSingleNode(String) SelectSingleNode(String) SelectSingleNode(String) SelectSingleNode(String) SelectSingleNode(String)

Applies the specified pattern-matching operation to this node's context and returns the first matching node.

SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object) SelectSingleNodeNS(String, Object)

Applies the specified pattern-matching operation to this node's context and returns the first matching node.

See Also