XPath.EvaluateToItem Method (IXPathNavigable)XPath.EvaluateToItem Method (IXPathNavigable)XPath::EvaluateToItem Method (IXPathNavigable^)

Returns an XPathItemXPathItemXPathItem representing the result of evaluating the XPath expression, or null a null reference (Nothing in Visual Basic) nullptr if the expression returns the empty sequence.

Syntax

Public Function EvaluateToItem( _
    contextItem As System.Xml.XPath.IXPathNavigable _
) As System.Xml.XPath.XPathItem
public:
System.Xml.XPath::XPathItem^ EvaluateToItem(
    System.Xml.XPath::IXPathNavigable^ contextItem
)
 

Return Value

Type: System.Xml.XPath.XPathItemSystem.Xml.XPath.XPathItemSystem.Xml.XPath::XPathItem^

An XPathItemXPathItemXPathItem, or null a null reference (Nothing in Visual Basic) nullptr if the expression returns the empty sequence.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptioncontextItem is null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmException An error occurred evaluating the expression. An XPST0004 error is raised if the expression did not return exactly one item.
LicenceExceptionLicenceExceptionLicenceExceptionThis version of XmlPrime has expired.

Remarks

The item in returned will either be an XPathNavigatorXPathNavigatorXPathNavigator instance (if the expression returns a node) or XPathAtomicValueXPathAtomicValueXPathAtomicValue instances (if the expression returns an atomic value). values).