Saxon API for .NET

XQueryEvaluator.EvaluateSingle Method 

Evaluate the query, returning the result as an XdmItem (that is, a single node or atomic value).

public XdmItem EvaluateSingle();

Return Value

An XdmItem representing the result of the query, or null if the query returns an empty sequence. If the query returns a sequence of more than one item, any items after the first are ignored.

Exceptions

Exception TypeCondition
DynamicErrorThrows a DynamicError if any run-time failure occurs while evaluating the expression.

See Also

XQueryEvaluator Class | Saxon.Api Namespace