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

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( _
    settings As DynamicContextSettings _
) As System.Xml.XPath.XPathItem
public System.Xml.XPath.XPathItem EvaluateToItem(
    DynamicContextSettings settings
)
public:
System.Xml.XPath::XPathItem^ EvaluateToItem(
    DynamicContextSettings^ settings
)
 

Parameters

settings

Type: XmlPrime.DynamicContextSettingsXmlPrime.DynamicContextSettingsXmlPrime::DynamicContextSettings^

The settings of the dynamic evaluation context.

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
ArgumentNullExceptionArgumentNullExceptionArgumentNullExceptionsettings 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.

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).

This method is not suitable for queries which use fn:put. Call to fn:put will raise an exception.