/** * Process the instruction, without returning any tail calls * @param context The dynamic context, giving access to the current node, * the current variables, etc. */ public void process(XPathContext context) throws XPathException { if (node != null) { context.getReceiver().append(node, 0, NodeInfo.ALL_NAMESPACES); } }
/** * Process the instruction, without returning any tail calls * * @param context The dynamic context, giving access to the current node, * the current variables, etc. * @throws XPathException if the current receiver fails for any reason, for example * with a serialization error due to invalid characters in the content */ public void process(/*@NotNull*/ XPathContext context) throws XPathException { context.getReceiver().append(this, ExplicitLocation.UNKNOWN_LOCATION, ReceiverOptions.ALL_NAMESPACES); }
/** * Process the instruction, without returning any tail calls * * @param context The dynamic context, giving access to the current node, * the current variables, etc. */ public void process(XPathContext context) throws XPathException { context.getReceiver().append(this, 0, NodeInfo.ALL_NAMESPACES); }
/** * Process the instruction, without returning any tail calls * @param context The dynamic context, giving access to the current node, * the current variables, etc. */ public void process(XPathContext context) throws XPathException { if (node != null) { context.getReceiver().append(node, 0, NodeInfo.ALL_NAMESPACES); } }
public TailCall processLeavingTail(XPathContext context) throws XPathException { // TODO: we're always constructing the document in memory. Sometimes we could push it out directly. Item item = evaluateItem(context); if (item != null) { SequenceReceiver out = context.getReceiver(); out.append(item, locationId, NodeInfo.ALL_NAMESPACES); } return null; }
/** * Process the value of the node, to create the new node. * * @param value the string value of the new node * @param context the dynamic evaluation context * @throws XPathException if a dynamic error occurs * */ public void processValue(CharSequence value, XPathContext context) throws XPathException { Receiver out = context.getReceiver(); out.characters(value, getLocation(), options); }
/** * Process the value of the node, to create the new node. * * @param value the string value of the new node * @param context the dynamic evaluation context * @throws XPathException if a dynamic error occurs * */ public void processValue(CharSequence value, XPathContext context) throws XPathException { Receiver out = context.getReceiver(); out.characters(value, getLocation(), options); }
/** * Process the value of the node, to create the new node. * * @param value the string value of the new node * @param context the dynamic evaluation context * @throws XPathException if a dynamic error occurs */ public void processValue(CharSequence value, XPathContext context) throws XPathException { String comment = checkContent(value.toString(), context); Receiver out = context.getReceiver(); out.comment(comment, getLocation(), 0); }
/** * Process the value of the node, to create the new node. * * @param value the string value of the new node * @param context the dynamic evaluation context * @throws XPathException if a dynamic error occurs */ public void processValue(CharSequence value, XPathContext context) throws XPathException { String comment = checkContent(value.toString(), context); Receiver out = context.getReceiver(); out.comment(comment, getLocation(), 0); }
/** * Process this instruction, to output a Comment Node * @param context the dynamic context for this transformation * @return a TailCall representing a call delegated to the caller. Always * returns null in this implementation */ public TailCall processLeavingTail(XPathContext context) throws XPathException { String comment = expandChildren(context).toString(); comment = checkContent(comment, context); SequenceReceiver out = context.getReceiver(); out.comment(comment, locationId, 0); return null; }
public void processValue(CharSequence value, XPathContext context) throws XPathException { String prefix = evaluatePrefix(context); String uri = value.toString(); checkPrefixAndUri(prefix, uri, context); NamespaceBinding nscode = new NamespaceBinding(prefix, uri); Receiver out = context.getReceiver(); out.namespace(nscode, ReceiverOptions.REJECT_DUPLICATES); }
public void processValue(CharSequence value, XPathContext context) throws XPathException { String prefix = evaluatePrefix(context); String uri = value.toString(); checkPrefixAndUri(prefix, uri, context); NamespaceBinding nscode = new NamespaceBinding(prefix, uri); Receiver out = context.getReceiver(); out.namespace(nscode, ReceiverOptions.REJECT_DUPLICATES); }
@Override public Receiver resolve(XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { URI absolute = getAbsoluteUri(href, baseUri); RawDestination destination = new RawDestination(); destination.onClose(() -> results.put(absolute.toASCIIString(), destination.getXdmValue())); return destination.getReceiver(context.getReceiver().getPipelineConfiguration(), properties); }
public static void renderStart(XPathContext saxonContext, RenderContextSaxon2 renderContext) throws Exception { try { if(renderContext.getResult() != null) { saxonContext.changeOutputDestination(saxonContext.getReceiver(), new ParseOptions()); } } catch(Exception x) { ExtensionFunctionUtils.setExtensionFunctionError(x); throw x; } }
@Override public Receiver resolve(XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { URI absolute = getAbsoluteUri(href, baseUri); XdmDestination destination = new XdmDestination(); destination.setDestinationBaseURI(absolute); destination.onClose(() -> { XdmNode root = destination.getXdmNode(); results.put(absolute.toASCIIString(), root.getUnderlyingValue().getTreeInfo()); }); return destination.getReceiver(context.getReceiver().getPipelineConfiguration(), properties); }
public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); String prefix = evaluatePrefix(context); String uri = expandChildren(context).toString(); checkPrefixAndUri(prefix, uri, context); int nscode = controller.getNamePool().allocateNamespaceCode(prefix, uri); SequenceReceiver out = context.getReceiver(); out.namespace(nscode, ReceiverOptions.REJECT_DUPLICATES); return null; }
/** * Process the instruction, without returning any tail calls * * @param context The dynamic context, giving access to the current node, * the current variables, etc. */ public final void process(XPathContext context) throws XPathException { SequenceIterator<?> iter = call(context, evaluateArguments(context)).iterate(); iter.forEachOrFail( it -> context.getReceiver().append(it, getLocation(), ReceiverOptions.ALL_NAMESPACES) ); }
/** * Process the value as an instruction, without returning any tail calls * * @param context The dynamic context, giving access to the current node, * the current variables, etc. */ public void process(XPathContext context) throws XPathException { Receiver out = context.getReceiver(); if (value instanceof Item) { out.append((Item) value, getLocation(), ReceiverOptions.ALL_NAMESPACES); } else { value.iterate().forEachOrFail(it -> out.append(it, getLocation(), ReceiverOptions.ALL_NAMESPACES)); } }
public void process(XPathContext c) throws XPathException { try { SequenceIterator<?> iter = evaluateVariable(c).iterate(); Receiver out = c.getReceiver(); Location loc = getLocation(); iter.forEachOrFail(item -> out.append(item, loc, ReceiverOptions.ALL_NAMESPACES)); } catch (XPathException err) { err.maybeSetLocation(getLocation()); throw err; } }
@Override public TailCall processLeavingTail(XPathContext context) throws XPathException { Receiver out = context.getReceiver(); try (SequenceIterator<?> iter = iterate(context)) { iter.forEachOrFail(it -> out.append(it, getLocation(), ReceiverOptions.ALL_NAMESPACES)); } catch (XPathException e) { e.maybeSetLocation(getLocation()); e.maybeSetContext(context); throw e; } return null; }