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

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

Syntax

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

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.

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.
XdmExceptionXdmExceptionXdmExceptionAn error occurred compiling or evaluating the XPath 2.0 expression.
InvalidCastExceptionInvalidCastExceptionInvalidCastExceptionThe return type contained an item which was not a node.