XPathNavigatorExtensions.XPathEvaluate Method (XPathNavigator, string)XPathNavigatorExtensions.XPathEvaluate Method (XPathNavigator, String)XPathNavigatorExtensions::XPathEvaluate Method (XPathNavigator^, String^)

Evaluates the specified XPath 2.0 expression and returns the typed result.

Syntax

Public Shared Function XPathEvaluate( _
    navigator As System.Xml.XPath.XPathNavigator, _
    expression As String _
) As Object
public static object XPathEvaluate(
    System.Xml.XPath.XPathNavigator navigator,
    string expression
)
public:
static object^ XPathEvaluate(
    System.Xml.XPath::XPathNavigator^ navigator, 
    String^ expression
)
 

Return Value

Type: System.ObjectSystem.ObjectSystem::Object^

The result of the evaluating the XPath 2.0 expression specified; otherwise, null a null reference (Nothing in Visual Basic) nullptr if there are no query results.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionexpression is null a null reference (Nothing in Visual Basic) nullptr.
InvalidOperationExceptionInvalidOperationExceptionInvalidOperationExceptionThe expression returned more than one item.
XdmExceptionXdmExceptionXdmExceptionAn error occurred compiling or evaluating the XPath 2.0 expression.