public JItem mapItem(JItem itemi) { JNodeInfo item = (JNodeInfo)itemi; bool isWhite = item.getNodeKind() == net.sf.saxon.type.Type.TEXT && JWhitespace.isWhite(item.getStringValueCS()); return(isWhite ? null : item); }
public override void append(JItem item, JLocation location, int copyNamespaces) { if (level == 0) { JXPathException e = new JXPathException("When writing to an XdmDestination, atomic values are only allowed within a document or element node"); } base.append(item, location, copyNamespaces); }
public override void append(JItem item, int locationId, int copyNamespaces) { if (this.locationId == -1) { this.locationId = locationId; } base.append(item, locationId, copyNamespaces); }
/// <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)); }
public override void write(JItem item) { XmlLocation loc = new XmlLocation(); if (locationId != -1) { JLocationProvider provider = getPipelineConfiguration().getLocationProvider(); loc.BaseUri = new Uri(provider.getSystemId(locationId)); loc.LineNumber = provider.getLineNumber(locationId); } listener.Message((XdmNode)XdmItem.Wrap(item), terminate, loc); }
/// <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() { JXPathContextMajor context = new JXPathContextMajor(contextItem, config); context.setStackFrame(env.getStackFrameMap(), variableValues); net.sf.saxon.om.Item i = exp.iterate(context).next(); 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); } }