XmlDocument XmlDocument XmlDocument XmlDocument Class

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

Syntax

Declaration

public sealed class XmlDocumentpublic sealed class XmlDocumentPublic NotInheritable Class XmlDocument

Constructors summary

Creates a new instance of the XmlDocument class.

Properties summary

Gets the list of attributes of this node.

Gets a list of children in the current node.

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.

Gets the root element of the document.

Returns the URL for the last loaded XML document.

Gets the first child node.

Gets the Implementation object for the document.

Gets the text from inside the XML.

Gets the last child node.

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

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

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

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

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

Gets or sets the text associated with the node.

Returns the root of the document that contains the node.

Gets the parent node of the node instance.

Gets or sets the namespace prefix.

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

Methods summary

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

Clones a new node.

Creates a new attribute with the specified name.

Creates a new attribute with the specified namespace and name.

Creates a CDATA section node that contains the supplied data.

Creates a comment node that contains the supplied data.

Creates an empty XmlDocumentFragment object.

Creates an element node using the specified name.

Creates an element node using the specified namespace and name.

Creates a new XmlEntityReference object.

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

Creates a text node that contains the supplied data.

Returns the element that matches the ID attribute.

Returns a collection of elements that have the specified name.

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

Determines whether a node has children.

Imports a node from another document to this document.

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

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

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

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

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

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

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

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

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

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

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

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

Asynchronously saves an XML document to the specified file.

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

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

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

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

Constructors

  • XmlDocument()
    XmlDocument()
    XmlDocument()
    XmlDocument()

    Creates a new instance of the XmlDocument class.

    public XmlDocument()public XmlDocument()Public Function XmlDocument() As

Properties

  • Attributes
    Attributes
    Attributes
    Attributes

    Gets the list of attributes of this node.

    public XmlNamedNodeMap Attributes { get; }public XmlNamedNodeMap Attributes { get; }Public ReadOnly Property Attributes As XmlNamedNodeMap

    Property Value

  • ChildNodes
    ChildNodes
    ChildNodes
    ChildNodes

    Gets a list of children in the current node.

    public XmlNodeList ChildNodes { get; }public XmlNodeList ChildNodes { get; }Public ReadOnly Property ChildNodes As XmlNodeList

    Property Value

  • Doctype
    Doctype
    Doctype
    Doctype

    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.

    public XmlDocumentType Doctype { get; }public XmlDocumentType Doctype { get; }Public ReadOnly Property Doctype As XmlDocumentType

    Property Value

  • DocumentElement
    DocumentElement
    DocumentElement
    DocumentElement

    Gets the root element of the document.

    public XmlElement DocumentElement { get; }public XmlElement DocumentElement { get; }Public ReadOnly Property DocumentElement As XmlElement

    Property Value

  • DocumentUri
    DocumentUri
    DocumentUri
    DocumentUri

    Returns the URL for the last loaded XML document.

    public string DocumentUri { get; }public string DocumentUri { get; }Public ReadOnly Property DocumentUri As string

    Property Value

    • string
      string
      string
      string

      The URL for the last loaded XML document.

  • FirstChild
    FirstChild
    FirstChild
    FirstChild

    Gets the first child node.

    public IXmlNode FirstChild { get; }public IXmlNode FirstChild { get; }Public ReadOnly Property FirstChild As IXmlNode

    Property Value

  • Implementation
    Implementation
    Implementation
    Implementation

    Gets the Implementation object for the document.

    public XmlDomImplementation Implementation { get; }public XmlDomImplementation Implementation { get; }Public ReadOnly Property Implementation As XmlDomImplementation

    Property Value

  • InnerText
    InnerText
    InnerText
    InnerText

    Gets the text from inside the XML.

    public string InnerText { get; set; }public string InnerText { get; set; }Public ReadWrite Property InnerText As string

    Property Value

    • string
      string
      string
      string

      The text from inside the XML. Returns an empty string if there is no text.

  • LastChild
    LastChild
    LastChild
    LastChild

    Gets the last child node.

    public IXmlNode LastChild { get; }public IXmlNode LastChild { get; }Public ReadOnly Property LastChild As IXmlNode

    Property Value

  • 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.

    public object LocalName { get; }public object LocalName { get; }Public ReadOnly Property LocalName As object

    Property Value

    • object
      object
      object
      object

      The local name.

  • NamespaceUri
    NamespaceUri
    NamespaceUri
    NamespaceUri

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

    public object NamespaceUri { get; }public object NamespaceUri { get; }Public ReadOnly Property NamespaceUri As object

    Property Value

    • object
      object
      object
      object

      The Uri for the namespace. This refers to the "uuu" portion of the namespace declaration xmlns:nnn="uuu".

  • 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.

    public IXmlNode NextSibling { get; }public IXmlNode NextSibling { get; }Public ReadOnly Property NextSibling As IXmlNode

    Property Value

  • 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.

    public string NodeName { get; }public string NodeName { get; }Public ReadOnly Property NodeName As string

    Property Value

    • string
      string
      string
      string

      The qualified node name, which varies depending on the node type.

  • 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.

    public NodeType NodeType { get; }public NodeType NodeType { get; }Public ReadOnly Property NodeType As NodeType

    Property Value

  • NodeValue
    NodeValue
    NodeValue
    NodeValue

    Gets or sets the text associated with the node.

    public object NodeValue { get; set; }public object NodeValue { get; set; }Public ReadWrite Property NodeValue As object

    Property Value

    • object
      object
      object
      object

      The text associated with the node.

    Remarks

    This value depends on the NodeType property. The following table describes this dependency.

    NodeTypeNodeValue
    ElementNull
    AttributeValue of attribute
    TextContent of the text node
    CDATASectionContent of the CDATA Section
    EntityReferenceNULL
    EntityNULL
    ProcessingInstructionEntire content excluding the target
    CommentContent of the comment
    DocumentNULL
    DocumentTypeNULL
    DocumentFragmentNULL
    NotationNULL
  • OwnerDocument
    OwnerDocument
    OwnerDocument
    OwnerDocument

    Returns the root of the document that contains the node.

    public XmlDocument OwnerDocument { get; }public XmlDocument OwnerDocument { get; }Public ReadOnly Property OwnerDocument As XmlDocument

    Property Value

  • ParentNode
    ParentNode
    ParentNode
    ParentNode

    Gets the parent node of the node instance.

    public IXmlNode ParentNode { get; }public IXmlNode ParentNode { get; }Public ReadOnly Property ParentNode As IXmlNode

    Property Value

  • Prefix
    Prefix
    Prefix
    Prefix

    Gets or sets the namespace prefix.

    public object Prefix { get; set; }public object Prefix { get; set; }Public ReadWrite Property Prefix As object

    Property Value

    • object
      object
      object
      object

      The namespace prefix specified on the element, attribute, or entity reference. For example, for the element <xxx:yyy>, this property returns xxx. It returns an empty string, "", if no prefix is specified.

  • 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.

    public IXmlNode PreviousSibling { get; }public IXmlNode PreviousSibling { get; }Public ReadOnly Property PreviousSibling As IXmlNode

    Property Value

Methods

  • AppendChild(Windows.Data.Xml.Dom.IXmlNode)
    AppendChild(Windows.Data.Xml.Dom.IXmlNode)
    AppendChild(Windows.Data.Xml.Dom.IXmlNode)
    AppendChild(Windows.Data.Xml.Dom.IXmlNode)

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

    public IXmlNode AppendChild(Windows.Data.Xml.Dom.IXmlNode newChild)public IXmlNode AppendChild(Windows.Data.Xml.Dom.IXmlNode newChild)Public Function AppendChild(newChild As Windows.Data.Xml.Dom.IXmlNode) As IXmlNode

    Parameters

    Returns

  • CloneNode(System.Boolean)
    CloneNode(System.Boolean)
    CloneNode(System.Boolean)
    CloneNode(System.Boolean)

    Clones a new node.

    public IXmlNode CloneNode(System.Boolean deep)public IXmlNode CloneNode(System.Boolean deep)Public Function CloneNode(deep As System.Boolean) As IXmlNode

    Parameters

    • deep
      System.Boolean
      System.Boolean
      System.Boolean
      System.Boolean

      A flag that indicates whether to recursively clone all nodes that are descendants of this node. If true, this method creates a clone of the complete tree below this node. If false, this method clones this node and its attributes only.

    Returns

  • CreateAttribute(System.String)
    CreateAttribute(System.String)
    CreateAttribute(System.String)
    CreateAttribute(System.String)

    Creates a new attribute with the specified name.

    public XmlAttribute CreateAttribute(System.String name)public XmlAttribute CreateAttribute(System.String name)Public Function CreateAttribute(name As System.String) As XmlAttribute

    Parameters

    • name
      System.String
      System.String
      System.String
      System.String

      The name of the new attribute object. This name is subsequently available as the new node's NodeName property.

    Returns

  • CreateAttributeNS(System.Object,System.String)
    CreateAttributeNS(System.Object,System.String)
    CreateAttributeNS(System.Object,System.String)
    CreateAttributeNS(System.Object,System.String)

    Creates a new attribute with the specified namespace and name.

    public XmlAttribute CreateAttributeNS(System.Object namespaceUri,System.String qualifiedName)public XmlAttribute CreateAttributeNS(System.Object namespaceUri,System.String qualifiedName)Public Function CreateAttributeNS(namespaceUri As System.Object,qualifiedName As System.String) As XmlAttribute

    Parameters

    • namespaceUri
      System.Object
      System.Object
      System.Object
      System.Object

      The name of the desired namespace or a null value if no namespace is desired.

    • qualifiedName
      System.String
      System.String
      System.String
      System.String

      The name of the new attribute object. This name is subsequently available as the new node's NodeName property.

    Returns

  • CreateCDataSection(System.String)
    CreateCDataSection(System.String)
    CreateCDataSection(System.String)
    CreateCDataSection(System.String)

    Creates a CDATA section node that contains the supplied data.

    public XmlCDataSection CreateCDataSection(System.String data)public XmlCDataSection CreateCDataSection(System.String data)Public Function CreateCDataSection(data As System.String) As XmlCDataSection

    Parameters

    • data
      System.String
      System.String
      System.String
      System.String

      The value to be supplied to the new CDATA section object's NodeValue property.

    Returns

  • CreateComment(System.String)
    CreateComment(System.String)
    CreateComment(System.String)
    CreateComment(System.String)

    Creates a comment node that contains the supplied data.

    public XmlComment CreateComment(System.String data)public XmlComment CreateComment(System.String data)Public Function CreateComment(data As System.String) As XmlComment

    Parameters

    • data
      System.String
      System.String
      System.String
      System.String

      The value to be supplied to the new comment object's NodeValue.

    Returns

  • CreateDocumentFragment()
    CreateDocumentFragment()
    CreateDocumentFragment()
    CreateDocumentFragment()

    Creates an empty XmlDocumentFragment object.

    public XmlDocumentFragment CreateDocumentFragment()public XmlDocumentFragment CreateDocumentFragment()Public Function CreateDocumentFragment() As XmlDocumentFragment

    Returns

  • CreateElement(System.String)
    CreateElement(System.String)
    CreateElement(System.String)
    CreateElement(System.String)

    Creates an element node using the specified name.

    public XmlElement CreateElement(System.String tagName)public XmlElement CreateElement(System.String tagName)Public Function CreateElement(tagName As System.String) As XmlElement

    Parameters

    • tagName
      System.String
      System.String
      System.String
      System.String

      The name for the new element node. The string is case-sensitive. This name is subsequently available as the element node's NodeName property.

    Returns

  • CreateElementNS(System.Object,System.String)
    CreateElementNS(System.Object,System.String)
    CreateElementNS(System.Object,System.String)
    CreateElementNS(System.Object,System.String)

    Creates an element node using the specified namespace and name.

    public XmlElement CreateElementNS(System.Object namespaceUri,System.String qualifiedName)public XmlElement CreateElementNS(System.Object namespaceUri,System.String qualifiedName)Public Function CreateElementNS(namespaceUri As System.Object,qualifiedName As System.String) As XmlElement

    Parameters

    • namespaceUri
      System.Object
      System.Object
      System.Object
      System.Object

      The name of the desired namespace or a null value if no namespace is desired.

    • qualifiedName
      System.String
      System.String
      System.String
      System.String

      The name for the new element node. It is case-sensitive. This name is subsequently available as the element node's NodeName property.

    Returns

  • CreateEntityReference(System.String)
    CreateEntityReference(System.String)
    CreateEntityReference(System.String)
    CreateEntityReference(System.String)

    Creates a new XmlEntityReference object.

    public XmlEntityReference CreateEntityReference(System.String name)public XmlEntityReference CreateEntityReference(System.String name)Public Function CreateEntityReference(name As System.String) As XmlEntityReference

    Parameters

    • name
      System.String
      System.String
      System.String
      System.String

      The name of the entity referenced. This name is subsequently available as the new object's NodeName property.

    Returns

  • CreateProcessingInstruction(System.String,System.String)
    CreateProcessingInstruction(System.String,System.String)
    CreateProcessingInstruction(System.String,System.String)
    CreateProcessingInstruction(System.String,System.String)

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

    public XmlProcessingInstruction CreateProcessingInstruction(System.String target,System.String data)public XmlProcessingInstruction CreateProcessingInstruction(System.String target,System.String data)Public Function CreateProcessingInstruction(target As System.String,data As System.String) As XmlProcessingInstruction

    Parameters

    • target
      System.String
      System.String
      System.String
      System.String

      The target part of the processing instruction. It supplies the NodeName property of the new object.

    • data
      System.String
      System.String
      System.String
      System.String

      The remainder of the processing instruction preceding the closing** ?>** characters. It supplies the NodeValue property for the new object.

    Returns

  • CreateTextNode(System.String)
    CreateTextNode(System.String)
    CreateTextNode(System.String)
    CreateTextNode(System.String)

    Creates a text node that contains the supplied data.

    public XmlText CreateTextNode(System.String data)public XmlText CreateTextNode(System.String data)Public Function CreateTextNode(data As System.String) As XmlText

    Parameters

    • data
      System.String
      System.String
      System.String
      System.String

      The value to be supplied to the new text object's NodeValue.

    Returns

  • GetElementById(System.String)
    GetElementById(System.String)
    GetElementById(System.String)
    GetElementById(System.String)

    Returns the element that matches the ID attribute.

    public XmlElement GetElementById(System.String elementId)public XmlElement GetElementById(System.String elementId)Public Function GetElementById(elementId As System.String) As XmlElement

    Parameters

    • elementId
      System.String
      System.String
      System.String
      System.String

      The ID to match.

    Returns

  • GetElementsByTagName(System.String)
    GetElementsByTagName(System.String)
    GetElementsByTagName(System.String)
    GetElementsByTagName(System.String)

    Returns a collection of elements that have the specified name.

    public XmlNodeList GetElementsByTagName(System.String tagName)public XmlNodeList GetElementsByTagName(System.String tagName)Public Function GetElementsByTagName(tagName As System.String) As XmlNodeList

    Parameters

    • tagName
      System.String
      System.String
      System.String
      System.String

      The element name to find. The value "*" returns all elements in the document.

    Returns

  • GetXml()
    GetXml()
    GetXml()
    GetXml()

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

    public string GetXml()public string GetXml()Public Function GetXml() As string

    Returns

    • string
      string
      string
      string

      The XML representation of the node and all its descendants.

  • HasChildNodes()
    HasChildNodes()
    HasChildNodes()
    HasChildNodes()

    Determines whether a node has children.

    public bool HasChildNodes()public bool HasChildNodes()Public Function HasChildNodes() As bool

    Returns

    • bool
      bool
      bool
      bool

      True if this node has children; otherwise false.

  • ImportNode(Windows.Data.Xml.Dom.IXmlNode,System.Boolean)
    ImportNode(Windows.Data.Xml.Dom.IXmlNode,System.Boolean)
    ImportNode(Windows.Data.Xml.Dom.IXmlNode,System.Boolean)
    ImportNode(Windows.Data.Xml.Dom.IXmlNode,System.Boolean)

    Imports a node from another document to this document.

    public IXmlNode ImportNode(Windows.Data.Xml.Dom.IXmlNode node,System.Boolean deep)public IXmlNode ImportNode(Windows.Data.Xml.Dom.IXmlNode node,System.Boolean deep)Public Function ImportNode(node As Windows.Data.Xml.Dom.IXmlNode,deep As System.Boolean) As IXmlNode

    Parameters

    • node

      The object to be cloned.

    • deep
      System.Boolean
      System.Boolean
      System.Boolean
      System.Boolean

      If true, any children of node will be cloned as well. If false, no children of the node will be cloned.

    Returns

    Remarks

    The returned node has no parent (the is null). The source node is not altered or removed from the original document; this method creates a new copy of the source node.

  • InsertBefore(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)
    InsertBefore(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)
    InsertBefore(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)
    InsertBefore(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)

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

    public IXmlNode InsertBefore(Windows.Data.Xml.Dom.IXmlNode newChild,Windows.Data.Xml.Dom.IXmlNode referenceChild)public IXmlNode InsertBefore(Windows.Data.Xml.Dom.IXmlNode newChild,Windows.Data.Xml.Dom.IXmlNode referenceChild)Public Function InsertBefore(newChild As Windows.Data.Xml.Dom.IXmlNode,referenceChild As Windows.Data.Xml.Dom.IXmlNode) As IXmlNode

    Parameters

    • newChild

      The address of the new node to be inserted. The node passed here must be a valid child of the current XML DOM document node. For example, if the current node is an attribute, you cannot pass another attribute in the newChild parameter, because an attribute cannot have an attribute as a child. If newChild is a DOCUMENT_FRAGMENT node type, all its children are inserted in order before referenceChild.

      If newChild is already in the tree, it is first removed before it is reinserted before the referenceChild node. Read-only nodes, such as NODE_DOCUMENT_TYPE and NODE_ENTITY nodes, cannot be passed in the newChild parameter.

    • referenceChild

      The reference node. The node specified is where the newChild node is to be inserted to the left as the preceding sibling in the child list. The node passed here must be a either a child node of the current node or null. If the value is null, the newChild node is inserted at the end of the child list. If the referenceChild node is not a child of the current node, an error is returned.

    Returns

  • LoadFromFileAsync(Windows.Storage.IStorageFile)
    LoadFromFileAsync(Windows.Storage.IStorageFile)
    LoadFromFileAsync(Windows.Storage.IStorageFile)
    LoadFromFileAsync(Windows.Storage.IStorageFile)

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

    public static IAsyncOperation<XmlDocument> LoadFromFileAsync(Windows.Storage.IStorageFile file)public static IAsyncOperation<XmlDocument> LoadFromFileAsync(Windows.Storage.IStorageFile file)Public Static Function LoadFromFileAsync(file As Windows.Storage.IStorageFile) As IAsyncOperation( Of XmlDocument )

    Parameters

    Returns

    • The object that must be used to start the operation.

  • LoadFromFileAsync(Windows.Storage.IStorageFile,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadFromFileAsync(Windows.Storage.IStorageFile,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadFromFileAsync(Windows.Storage.IStorageFile,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadFromFileAsync(Windows.Storage.IStorageFile,Windows.Data.Xml.Dom.XmlLoadSettings)

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

    public static IAsyncOperation<XmlDocument> LoadFromFileAsync(Windows.Storage.IStorageFile file,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)public static IAsyncOperation<XmlDocument> LoadFromFileAsync(Windows.Storage.IStorageFile file,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)Public Static Function LoadFromFileAsync(file As Windows.Storage.IStorageFile,loadSettings As Windows.Data.Xml.Dom.XmlLoadSettings) As IAsyncOperation( Of XmlDocument )

    Parameters

    Returns

    • The object that must be used to start the operation.

  • LoadFromUriAsync(Windows.Foundation.Uri)
    LoadFromUriAsync(Windows.Foundation.Uri)
    LoadFromUriAsync(Windows.Foundation.Uri)
    LoadFromUriAsync(Windows.Foundation.Uri)

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

    public static IAsyncOperation<XmlDocument> LoadFromUriAsync(Windows.Foundation.Uri uri)public static IAsyncOperation<XmlDocument> LoadFromUriAsync(Windows.Foundation.Uri uri)Public Static Function LoadFromUriAsync(uri As Windows.Foundation.Uri) As IAsyncOperation( Of XmlDocument )

    Parameters

    • uri

      A URL that specifies the location of the XML file.

    Returns

    • The object that must be used to start the operation.

  • LoadFromUriAsync(Windows.Foundation.Uri,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadFromUriAsync(Windows.Foundation.Uri,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadFromUriAsync(Windows.Foundation.Uri,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadFromUriAsync(Windows.Foundation.Uri,Windows.Data.Xml.Dom.XmlLoadSettings)

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

    public static IAsyncOperation<XmlDocument> LoadFromUriAsync(Windows.Foundation.Uri uri,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)public static IAsyncOperation<XmlDocument> LoadFromUriAsync(Windows.Foundation.Uri uri,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)Public Static Function LoadFromUriAsync(uri As Windows.Foundation.Uri,loadSettings As Windows.Data.Xml.Dom.XmlLoadSettings) As IAsyncOperation( Of XmlDocument )

    Parameters

    Returns

    • An object that must be used to start the operation.

    Remarks

    This operation does not start until a call is made to the IAsyncOperation::StartOperation method.

  • LoadXml(System.String)
    LoadXml(System.String)
    LoadXml(System.String)
    LoadXml(System.String)

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

    public void LoadXml(System.String xml)public void LoadXml(System.String xml)Public Function LoadXml(xml As System.String) As void

    Parameters

    • xml
      System.String
      System.String
      System.String
      System.String

      The XML string to load into this XML document object. This string can contain an entire XML document or a well-formed fragment.

  • LoadXml(System.String,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadXml(System.String,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadXml(System.String,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadXml(System.String,Windows.Data.Xml.Dom.XmlLoadSettings)

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

    public void LoadXml(System.String xml,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)public void LoadXml(System.String xml,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)Public Function LoadXml(xml As System.String,loadSettings As Windows.Data.Xml.Dom.XmlLoadSettings) As void

    Parameters

    • xml
      System.String
      System.String
      System.String
      System.String

      The XML string to load into this XML document object. This string can contain an entire XML document or a well-formed fragment.

    • loadSettings

      The settings for parsing the document.

  • LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer)
    LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer)
    LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer)
    LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer)

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

    public void LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer buffer)public void LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer buffer)Public Function LoadXmlFromBuffer(buffer As Windows.Storage.Streams.IBuffer) As void

    Parameters

    • buffer

      The buffer to load into this XML document object. This buffer can contain an entire XML document or a well-formed fragment.

  • LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer,Windows.Data.Xml.Dom.XmlLoadSettings)
    LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer,Windows.Data.Xml.Dom.XmlLoadSettings)

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

    public void LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer buffer,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)public void LoadXmlFromBuffer(Windows.Storage.Streams.IBuffer buffer,Windows.Data.Xml.Dom.XmlLoadSettings loadSettings)Public Function LoadXmlFromBuffer(buffer As Windows.Storage.Streams.IBuffer,loadSettings As Windows.Data.Xml.Dom.XmlLoadSettings) As void

    Parameters

  • Normalize()
    Normalize()
    Normalize()
    Normalize()

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

    public void Normalize()public void Normalize()Public Function Normalize() As void
  • RemoveChild(Windows.Data.Xml.Dom.IXmlNode)
    RemoveChild(Windows.Data.Xml.Dom.IXmlNode)
    RemoveChild(Windows.Data.Xml.Dom.IXmlNode)
    RemoveChild(Windows.Data.Xml.Dom.IXmlNode)

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

    public IXmlNode RemoveChild(Windows.Data.Xml.Dom.IXmlNode childNode)public IXmlNode RemoveChild(Windows.Data.Xml.Dom.IXmlNode childNode)Public Function RemoveChild(childNode As Windows.Data.Xml.Dom.IXmlNode) As IXmlNode

    Parameters

    Returns

  • ReplaceChild(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)
    ReplaceChild(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)
    ReplaceChild(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)
    ReplaceChild(Windows.Data.Xml.Dom.IXmlNode,Windows.Data.Xml.Dom.IXmlNode)

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

    public IXmlNode ReplaceChild(Windows.Data.Xml.Dom.IXmlNode newChild,Windows.Data.Xml.Dom.IXmlNode referenceChild)public IXmlNode ReplaceChild(Windows.Data.Xml.Dom.IXmlNode newChild,Windows.Data.Xml.Dom.IXmlNode referenceChild)Public Function ReplaceChild(newChild As Windows.Data.Xml.Dom.IXmlNode,referenceChild As Windows.Data.Xml.Dom.IXmlNode) As IXmlNode

    Parameters

    Returns

  • SaveToFileAsync(Windows.Storage.IStorageFile)
    SaveToFileAsync(Windows.Storage.IStorageFile)
    SaveToFileAsync(Windows.Storage.IStorageFile)
    SaveToFileAsync(Windows.Storage.IStorageFile)

    Asynchronously saves an XML document to the specified file.

    public IAsyncAction SaveToFileAsync(Windows.Storage.IStorageFile file)public IAsyncAction SaveToFileAsync(Windows.Storage.IStorageFile file)Public Function SaveToFileAsync(file As Windows.Storage.IStorageFile) As IAsyncAction

    Parameters

    Returns

  • SelectNodes(System.String)
    SelectNodes(System.String)
    SelectNodes(System.String)
    SelectNodes(System.String)

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

    public XmlNodeList SelectNodes(System.String xpath)public XmlNodeList SelectNodes(System.String xpath)Public Function SelectNodes(xpath As System.String) As XmlNodeList

    Parameters

    • xpath
      System.String
      System.String
      System.String
      System.String

      Specifies an XPath expression.

    Returns

  • SelectNodesNS(System.String,System.Object)
    SelectNodesNS(System.String,System.Object)
    SelectNodesNS(System.String,System.Object)
    SelectNodesNS(System.String,System.Object)

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

    public XmlNodeList SelectNodesNS(System.String xpath,System.Object namespaces)public XmlNodeList SelectNodesNS(System.String xpath,System.Object namespaces)Public Function SelectNodesNS(xpath As System.String,namespaces As System.Object) As XmlNodeList

    Parameters

    • xpath
      System.String
      System.String
      System.String
      System.String

      Specifies an XPath expression.

    • namespaces
      System.Object
      System.Object
      System.Object
      System.Object

      Contains a string that specifies namespaces for use in XPath expressions when it is necessary to define new namespaces externally. Namespaces are defined in the XML style, as a space-separated list of namespace declaration attributes. You can use this property to set the default namespace as well.

    Returns

    Remarks

    Prefixes in the query are resolved using the specified namespace declarations.

  • SelectSingleNode(System.String)
    SelectSingleNode(System.String)
    SelectSingleNode(System.String)
    SelectSingleNode(System.String)

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

    public IXmlNode SelectSingleNode(System.String xpath)public IXmlNode SelectSingleNode(System.String xpath)Public Function SelectSingleNode(xpath As System.String) As IXmlNode

    Parameters

    • xpath
      System.String
      System.String
      System.String
      System.String

      Specifies an XPath expression.

    Returns

    • The first node that matches the given pattern-matching operation. If no nodes match the expression, the method returns a null value.

  • SelectSingleNodeNS(System.String,System.Object)
    SelectSingleNodeNS(System.String,System.Object)
    SelectSingleNodeNS(System.String,System.Object)
    SelectSingleNodeNS(System.String,System.Object)

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

    public IXmlNode SelectSingleNodeNS(System.String xpath,System.Object namespaces)public IXmlNode SelectSingleNodeNS(System.String xpath,System.Object namespaces)Public Function SelectSingleNodeNS(xpath As System.String,namespaces As System.Object) As IXmlNode

    Parameters

    • xpath
      System.String
      System.String
      System.String
      System.String

      Specifies an XPath expression.

    • namespaces
      System.Object
      System.Object
      System.Object
      System.Object

      Contains a string that specifies the namespaces to use in XPath expressions when it is necessary to define new namespaces externally. Namespaces are defined in the XML style, as a space-separated list of namespace declaration attributes. You can use this property to set the default namespace as well.

    Returns

    • The first node that matches the given pattern-matching operation. If no nodes match the expression, this method returns a null value.

    Remarks

    Prefixes in the query are resolved using the specified namespace declarations.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MuseAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ActivatableAttribute

Details

Assembly

Windows.Data.Xml.Dom.dll