/** * 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 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 */ @Override public void append(Item item, Location locationId, int copyNamespaces) throws XPathException { if (item instanceof ArrayItem) { flatten((ArrayItem) item, locationId, copyNamespaces); } else { if (item instanceof AtomicValue) { sep(); nextReceiver.characters(item.getStringValueCS(), locationId, 0); } else { decompose(item, locationId, copyNamespaces); } } }
/** * Output a comment */ @Override public void comment(CharSequence chars, Location locationId, int properties) throws XPathException { sep(); super.comment(chars, locationId, properties); }
public SequenceReceiver makeSequenceNormalizer(Receiver receiver, Properties properties) { String method = properties.getProperty(OutputKeys.METHOD); if ("json".equals(method) || "adaptive".equals(method)) { return receiver instanceof SequenceReceiver ? (SequenceReceiver)receiver : new TreeReceiver(receiver); } else { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); SequenceReceiver result; String separator = properties.getProperty(SaxonOutputKeys.ITEM_SEPARATOR); if (separator == null || "#absent".equals(separator)) { result = new SequenceNormalizerWithSpaceSeparator(receiver); } else { result = new SequenceNormalizerWithItemSeparator(receiver, separator); } result.setPipelineConfiguration(pipe); return result; } }
/** * Start of a document node. */ @Override public void startDocument(int properties) throws XPathException { sep(); super.startDocument(properties); }
public SequenceReceiver makeSequenceNormalizer(Receiver receiver, Properties properties) { String method = properties.getProperty(OutputKeys.METHOD); if ("json".equals(method) || "adaptive".equals(method)) { return receiver instanceof SequenceReceiver ? (SequenceReceiver)receiver : new TreeReceiver(receiver); } else { PipelineConfiguration pipe = receiver.getPipelineConfiguration(); SequenceReceiver result; String separator = properties.getProperty(SaxonOutputKeys.ITEM_SEPARATOR); if (separator == null || "#absent".equals(separator)) { result = new SequenceNormalizerWithSpaceSeparator(receiver); } else { result = new SequenceNormalizerWithItemSeparator(receiver, separator); } result.setPipelineConfiguration(pipe); return result; } }
/** * 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 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 */ @Override public void append(Item item, Location locationId, int copyNamespaces) throws XPathException { if (item instanceof ArrayItem) { flatten((ArrayItem) item, locationId, copyNamespaces); } else { if (item instanceof AtomicValue) { sep(); nextReceiver.characters(item.getStringValueCS(), locationId, 0); } else { decompose(item, locationId, copyNamespaces); } } }
/** * Character data */ @Override public void characters(CharSequence chars, Location locationId, int properties) throws XPathException { sep(); super.characters(chars, locationId, properties); }
/** * Convenience method to create an appropriate SequenceNormalizer, based * on the item-separator appearing in the serialization parameters. If the * serialization parameters include a request for validation, then a validator * will also be inserted into the pipeline immediately after the SequenceNormalizer, * as required by the rules for {@code xsl:result-document}. * @param next the next {@code Receiver in the pipeline} * @return the new {@code SequenceNormalizer}, feeding into the supplied {@code Receiver}, * possibly via a new validating filter. */ public SequenceNormalizer makeSequenceNormalizer(Receiver next) { if (getValidationFactory() != null) { next = getValidationFactory().makeFilter(next); } String itemSeparator = properties.getProperty(SaxonOutputKeys.ITEM_SEPARATOR); return itemSeparator == null || "#absent".equals(itemSeparator) ? new SequenceNormalizerWithSpaceSeparator(next) : new SequenceNormalizerWithItemSeparator(next, itemSeparator); }
/** * Notify the start of an element * @param elemName integer code identifying the name of the element within the name pool. * @param typeCode integer code identifying the element's type within the name pool. * @param location * @param properties properties of the element node */ @Override public void startElement(NodeName elemName, SchemaType typeCode, Location location, int properties) throws XPathException { sep(); super.startElement(elemName, typeCode, location, properties); }
/** * Convenience method to create an appropriate SequenceNormalizer, based * on the item-separator appearing in the serialization parameters. If the * serialization parameters include a request for validation, then a validator * will also be inserted into the pipeline immediately after the SequenceNormalizer, * as required by the rules for {@code xsl:result-document}. * @param next the next {@code Receiver in the pipeline} * @return the new {@code SequenceNormalizer}, feeding into the supplied {@code Receiver}, * possibly via a new validating filter. */ public SequenceNormalizer makeSequenceNormalizer(Receiver next) { if (getValidationFactory() != null) { next = getValidationFactory().makeFilter(next); } String itemSeparator = properties.getProperty(SaxonOutputKeys.ITEM_SEPARATOR); return itemSeparator == null || "#absent".equals(itemSeparator) ? new SequenceNormalizerWithSpaceSeparator(next) : new SequenceNormalizerWithItemSeparator(next, itemSeparator); }
/** * Processing Instruction */ @Override public void processingInstruction(String target, CharSequence data, Location locationId, int properties) throws XPathException { sep(); super.processingInstruction(target, data, locationId, properties); }
/** * Processing Instruction */ @Override public void processingInstruction(String target, CharSequence data, Location locationId, int properties) throws XPathException { sep(); super.processingInstruction(target, data, locationId, properties); }
/** * Output a comment */ @Override public void comment(CharSequence chars, Location locationId, int properties) throws XPathException { sep(); super.comment(chars, locationId, properties); }
/** * Notify the start of an element * @param elemName integer code identifying the name of the element within the name pool. * @param typeCode integer code identifying the element's type within the name pool. * @param location * @param properties properties of the element node */ @Override public void startElement(NodeName elemName, SchemaType typeCode, Location location, int properties) throws XPathException { sep(); super.startElement(elemName, typeCode, location, properties); }
/** * Character data */ @Override public void characters(CharSequence chars, Location locationId, int properties) throws XPathException { sep(); super.characters(chars, locationId, properties); }
/** * Start of a document node. */ @Override public void startDocument(int properties) throws XPathException { sep(); super.startDocument(properties); }