XPathNavigatorExtensions.XPathEvaluate Method (XPathNavigator, string, IXmlNamespaceResolver)XPathNavigatorExtensions.XPathEvaluate Method (XPathNavigator, String, IXmlNamespaceResolver)XPathNavigatorExtensions::XPathEvaluate Method (XPathNavigator^, String^, IXmlNamespaceResolver^)
Evaluates the specified XPath 2.0 expression and returns the typed result.
Evaluates the specified XPath 2.0 expression to select a single node.
- Namespace: XmlPrime.ExtensionMethodsXmlPrime.ExtensionMethodsXmlPrime.ExtensionMethods
- Assembly: XmlPrime.ExtensionMethods (in XmlPrime.ExtensionMethods.dll)
Syntax
Public Shared Function XPathEvaluate( _ navigator As System.Xml.XPath.XPathNavigator, _ expression As String, _ resolver As System.Xml.IXmlNamespaceResolver _ ) As Object
public static object XPathEvaluate( System.Xml.XPath.XPathNavigator navigator, string expression, System.Xml.IXmlNamespaceResolver resolver )
public: static object^ XPathEvaluate( System.Xml.XPath::XPathNavigator^ navigator, String^ expression, System.Xml::IXmlNamespaceResolver^ resolver )
Parameters
- navigator
Type: System.Xml.XPath.XPathNavigatorSystem.Xml.XPath.XPathNavigatorSystem.Xml.XPath::XPathNavigator^
The XPathNavigatorXPathNavigatorXPathNavigator to use as the context item.
- 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.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
Exception | Condition |
ArgumentNullExceptionArgumentNullExceptionArgumentNullException | expression is null
a null reference (Nothing in Visual Basic)
nullptr or resolver is null
a null reference (Nothing in Visual Basic)
nullptr . |
XdmExceptionXdmExceptionXdmException | An error occurred compiling or evaluating the XPath 2.0 expression. |
InvalidOperationExceptionInvalidOperationExceptionInvalidOperationException | The expression returned more than one item. |
XdmExceptionXdmExceptionXdmException | An error occurred compiling or evaluating the XPath 2.0 expression. |