XmlNodeExtensions.XPathSelectNodes Method (XmlNode, string, IXmlNamespaceResolver)XmlNodeExtensions.XPathSelectNodes Method (XmlNode, String, IXmlNamespaceResolver)XmlNodeExtensions::XPathSelectNodes Method (XmlNode^, String^, IXmlNamespaceResolver^)

Selects a node set, using the specified XPath 2.0 expressions.

Syntax

Public Shared Function XPathSelectNodes( _
    node As System.Xml.XmlNode, _
    expression As String, _
    resolver As System.Xml.IXmlNamespaceResolver _
) As System.Xml.XmlNodeList
public static System.Xml.XmlNodeList XPathSelectNodes(
    System.Xml.XmlNode node,
    string expression,
    System.Xml.IXmlNamespaceResolver resolver
)
public:
static System.Xml::XmlNodeList^ XPathSelectNodes(
    System.Xml::XmlNode^ node, 
    String^ expression, 
    System.Xml::IXmlNamespaceResolver^ resolver
)
 

Parameters

node

Type: System.Xml.XmlNodeSystem.Xml.XmlNodeSystem.Xml::XmlNode^

The XmlNodeXmlNodeXmlNode to use as the context item.

expression

Type: System.StringSystem.StringSystem::String^

A stringStringString representing the XPath 2.0 expression.

resolver

Type: System.Xml.IXmlNamespaceResolverSystem.Xml.IXmlNamespaceResolverSystem.Xml::IXmlNamespaceResolver^

The IXmlNamespaceResolverIXmlNamespaceResolverIXmlNamespaceResolver object used to resolve namespace prefixes in the XPath 2.0 expression.

Return Value

Type: System.Xml.XmlNodeListSystem.Xml.XmlNodeListSystem.Xml::XmlNodeList^

An XPathNodeIteratorXPathNodeIteratorXPathNodeIterator object that contains the matching nodes for the XPath 2.0 expression specified.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionexpression is null a null reference (Nothing in Visual Basic) nullptr or resolver is null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmExceptionAn error occurred compiling or evaluating the XPath 2.0 expression.
InvalidCastExceptionInvalidCastExceptionInvalidCastExceptionThe return type contained an item which was not a node.