/// <summary> /// Evaluate the expression, returning the result as an <c>XdmValue</c> (that is, /// a sequence of nodes and/or atomic values). /// </summary> /// <remarks> /// Although a singleton result <i>may</i> be represented as an <c>XdmItem</c>, there is /// no guarantee that this will always be the case. If you know that the expression will return at /// most one node or atomic value, it is best to use the <c>EvaluateSingle</c> method, which /// does guarantee that an <c>XdmItem</c> (or null) will be returned. /// </remarks> /// <returns> /// An <c>XdmValue</c> representing the results of the expression. /// </returns> public XdmValue Evaluate() { JValueRepresentation value = JSequenceExtent.makeSequenceExtent( exp.iterate(dynamicContext)); return(XdmValue.Wrap(value)); }
/// <summary> /// Evaluate the expression, returning the result as an <c>XdmValue</c> (that is, /// a sequence of nodes and/or atomic values). /// </summary> /// <remarks> /// Although a singleton result <i>may</i> be represented as an <c>XdmItem</c>, there is /// no guarantee that this will always be the case. If you know that the expression will return at /// most one node or atomic value, it is best to use the <c>EvaluateSingle</c> method, which /// does guarantee that an <c>XdmItem</c> (or null) will be returned. /// </remarks> /// <returns> /// An <c>XdmValue</c> representing the results of the expression. /// </returns> public XdmValue Evaluate() { JXPathContextMajor context = new JXPathContextMajor(contextItem, config); context.setStackFrame(env.getStackFrameMap(), variableValues); JValueRepresentation value = JSequenceExtent.makeSequenceExtent(exp.iterate(context)); return(XdmValue.Wrap(value)); }
/// <summary> /// Evaluate the expression, returning the result as an <c>XdmValue</c> (that is, /// a sequence of nodes and/or atomic values). /// </summary> /// <remarks> /// Although a singleton result <i>may</i> be represented as an <c>XdmItem</c>, there is /// no guarantee that this will always be the case. If you know that the expression will return at /// most one node or atomic value, it is best to use the <c>EvaluateSingle</c> method, which /// does guarantee that an <c>XdmItem</c> (or null) will be returned. /// </remarks> /// <returns> /// An <c>XdmValue</c> representing the results of the expression. /// </returns> /// <exception cref="DynamicError"> /// Throws <c>Saxon.Api.DynamicError</c> if the evaluation of the XPath expression fails /// with a dynamic error. /// </exception> public XdmValue Evaluate() { try { JSequence value = (JSequence)JSequenceExtent.makeSequenceExtent( exp.iterate(dynamicContext)); return(XdmValue.Wrap(value)); } catch (net.sf.saxon.trans.XPathException err) { throw new DynamicError(err); } }
/// <summary> /// Evaluate the query, returning the result as an <c>XdmValue</c> (that is, /// a sequence of nodes and/or atomic values). /// </summary> /// <returns> /// An <c>XdmValue</c> representing the results of the query /// </returns> /// <exception cref="DynamicError">Throws a DynamicError if any run-time failure /// occurs while evaluating the query.</exception> public XdmValue Evaluate() { try { JGroundedValue value = JSequenceExtent.makeSequenceExtent(exp.iterator(context)); return(XdmValue.Wrap(value)); } catch (JXPathException err) { throw new DynamicError(err); } }