XQuery.Evaluate Method (XPathItem, IResultDocumentHandler)XQuery.Evaluate Method (XPathItem, IResultDocumentHandler)XQuery::Evaluate Method (XPathItem^, IResultDocumentHandler^)

Returns an IEnumerable<T>IEnumerable(Of T)IEnumerable<T> representing the result of evaluating the XQuery program.

Syntax

Public Function Evaluate( _
    contextItem As System.Xml.XPath.XPathItem, _
    resultDocumentHandler As IResultDocumentHandler _
) As IEnumerable(Of System.Xml.XPath.XPathItem)
public IEnumerable<System.Xml.XPath.XPathItem> Evaluate(
    System.Xml.XPath.XPathItem contextItem,
    IResultDocumentHandler resultDocumentHandler
)
public:
IEnumerable<System.Xml.XPath::XPathItem^>^ Evaluate(
    System.Xml.XPath::XPathItem^ contextItem, 
    IResultDocumentHandler^ resultDocumentHandler
)
 

Parameters

contextItem

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

The initial context item for the query.

resultDocumentHandler

Type: XmlPrime.IResultDocumentHandlerXmlPrime.IResultDocumentHandlerXmlPrime::IResultDocumentHandler^

The result document handler.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptioncontextItem or resultDocumentHandler are null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmException An error occurred evaluating the query.

Remarks

The results of the query 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 IEnumerable<T>IEnumerable(Of T)IEnumerable<T>.

The items in the returned IEnumerable<T>IEnumerable(Of T)IEnumerable<T> will all be instances of XPathNavigatorXPathNavigatorXPathNavigator (if the expression returns a node), XPathAtomicValueXPathAtomicValueXPathAtomicValue (if the expression returns an atomic value) or XPathFunctionItemXPathFunctionItemXPathFunctionItem (if the expression returns a function item).

This method is suitable for queries which use fn:put.