I​Xml​Node​Selector I​Xml​Node​Selector I​Xml​Node​Selector Interface

Definition

Encapsulates the methods needed to execute XPath queries on an XML DOM tree or subtree.

public interface IXmlNodeSelectorpublic interface IXmlNodeSelectorPublic Interface IXmlNodeSelector
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Methods

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.

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

Specifies an XPath expression.

Returns

The collection of nodes selected by applying the given pattern-matching operation. If no nodes are selected, this method returns an empty collection.

Attributes

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.

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

Specifies an XPath expresssion.

namespaces
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

The collection of nodes selected by applying the given pattern-matching operation. If no nodes are selected, returns an empty collection.

Attributes

Remarks

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

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

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

public IXmlNode SelectSingleNode(String xpath)public IXmlNode SelectSingleNode(String xpath)Public Function SelectSingleNode(xpath As String) As IXmlNode
Parameters
xpath
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.

Attributes

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.

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

Specifies an XPath expression.

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

Attributes

Remarks

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