/// <summary> /// Evaluate the XPath expression, returning the result as an <c>XdmItem</c> (that is, /// a single node or atomic value). /// </summary> /// <returns> /// An <c>XdmItem</c> representing the result of the expression, or null if the expression /// returns an empty sequence. If the expression returns a sequence of more than one item, /// any items after the first are ignored. /// </returns> public XdmItem EvaluateSingle() { net.sf.saxon.om.Item i = exp.evaluateSingle(dynamicContext); if (i == null) { return(null); } return((XdmItem)XdmValue.Wrap(i)); }
/// <summary> /// Evaluate the XPath expression, returning the result as an <c>XdmItem</c> (that is, /// a single node or atomic value). /// </summary> /// <returns> /// An <c>XdmItem</c> representing the result of the expression, or null if the expression /// returns an empty sequence. If the expression returns a sequence of more than one item, /// any items after the first are ignored. /// </returns> /// <exception cref="DynamicError"> /// Throws <c>Saxon.Api.DynamicError</c> if the evaluation of the XPath expression fails /// with a dynamic error. /// </exception> public XdmItem EvaluateSingle() { try { net.sf.saxon.om.Item i = exp.evaluateSingle(dynamicContext); if (i == null) { return(null); } return((XdmItem)XdmValue.Wrap(i)); } catch (net.sf.saxon.trans.XPathException err) { throw new DynamicError(err); } }