XQuery.EvaluateToItem Method (XPathItem)XQuery.EvaluateToItem Method (XPathItem)XQuery::EvaluateToItem Method (XPathItem^)

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

Syntax

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

Parameters

contextItem

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

The context item for the query.

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 query returns the empty sequence.

Exceptions

ExceptionCondition
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptioncontextItem is null a null reference (Nothing in Visual Basic) nullptr.
XdmExceptionXdmExceptionXdmException An error occurred evaluating the query.
InvalidOperationExceptionInvalidOperationExceptionInvalidOperationException An error is raised if the expression returns more than one item, or if the query is an updating expression.
LicenceExceptionLicenceExceptionLicenceExceptionThis version of XmlPrime has expired.

Remarks

The item returned will either be an instance 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 not suitable for queries which use fn:put. Call to fn:put will raise an exception.