/** * Append an arbitrary item (node, atomic value, or function) to the output. * By default, if the item is an element node, it is copied with all namespaces. * The default implementation calls {@link #append(Item, Location, int)}, whose * default implementation throws {@code UnsupportedOperationException} * * @param item the item to be appended * @throws net.sf.saxon.trans.XPathException if the operation fails */ default void append(Item item) throws XPathException { append(item, ExplicitLocation.UNKNOWN_LOCATION, ReceiverOptions.ALL_NAMESPACES); }
@Override public void replay(Receiver out) throws XPathException { out.append(item, location, properties); } }
/** * Append an arbitrary item (node, atomic value, or function) to the output. * By default, if the item is an element node, it is copied with all namespaces. * The default implementation calls {@link #append(Item, Location, int)}, whose * default implementation throws {@code UnsupportedOperationException} * * @param item the item to be appended * @throws net.sf.saxon.trans.XPathException if the operation fails */ default void append(Item item) throws XPathException { append(item, ExplicitLocation.UNKNOWN_LOCATION, ReceiverOptions.ALL_NAMESPACES); }
/** * Append an arbitrary item (node or atomic value) to the output * * @param item the item to be appended * @param locationId the location of the calling instruction, for diagnostics * @param properties if the item is an element node, this indicates whether its namespaces * need to be copied. Values are {@link ReceiverOptions#ALL_NAMESPACES}, * {@link ReceiverOptions#LOCAL_NAMESPACES}; the default (0) means * no namespaces */ public void append(Item item, Location locationId, int properties) throws XPathException { nextReceiver.append(item, locationId, properties); }
@Override public void replay(Receiver out) throws XPathException { out.append(item, location, properties); } }
/** * 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); }
@Override public void append(Item item, Location locationId, int copyNamespaces) throws XPathException { useAsPrimary(); nextReceiver.append(item, locationId, copyNamespaces); }
@Override public void append(Item item, Location locationId, int copyNamespaces) throws XPathException { useAsPrimary(); nextReceiver.append(item, locationId, copyNamespaces); }
/** * 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); }
/** * Append an arbitrary item (node or atomic value) to the output. In a regular sequence, append * events occur only at the top level, that is, when the document / element stack is empty. * * @param item the item to be appended * @param locationId the location of the calling instruction, for diagnostics * @param copyNamespaces if the item is an element node, this indicates whether its namespaces * need to be copied. Values are {@link ReceiverOptions#ALL_NAMESPACES}, * {@link ReceiverOptions#LOCAL_NAMESPACES}; the default (0) means * no namespaces */ public void append(Item item, Location locationId, int copyNamespaces) throws XPathException { transition("append"); nextReceiver.append(item, locationId, copyNamespaces); }
/** * 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)); } }
/** * 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)); } }
/** * 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 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) ); }
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; }
@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; }
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; } }