XPath.Evaluate Method (XPathItem)XPath.Evaluate Method (XPathItem)XPath::Evaluate Method (XPathItem^)

Returns an XPathItemCollectionXPathItemCollectionXPathItemCollection representing the result of evaluating the XPath expression.

Syntax

Public Function Evaluate( _
    contextItem As System.Xml.XPath.XPathItem _
) As XPathItemCollection
public XPathItemCollection Evaluate(
    System.Xml.XPath.XPathItem contextItem
)
public:
XPathItemCollection^ Evaluate(
    System.Xml.XPath::XPathItem^ contextItem
)
 

Parameters

contextItem

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

The context item for the expression.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptioncontextItem is null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmException An error occurred evaluating the expression.

Remarks

The items in the returned XPathItemCollectionXPathItemCollectionXPathItemCollection will all either be XPathNavigatorXPathNavigatorXPathNavigator instances (for nodes) or XPathAtomicValueXPathAtomicValueXPathAtomicValue instances (for atomic values).

The results of the expression are only evaluated whilst they are enumerated. Any errors encountered during evaluation may be thrown from the MoveNextMoveNextMoveNext method and CurrentCurrentCurrent property of the enumerator over the XPathItemCollectionXPathItemCollectionXPathItemCollection.