/** * Character data (corresponding to a text node). For character data within content (that is, events occurring * when the startDocument / startElement stack is non-empty), character data events will never be consecutive * and will never be zero-length. */ public void characters(CharSequence chars, Location locationId, int properties) throws XPathException { transition("text"); if (chars.length() == 0 && !stack.isEmpty()) { throw new IllegalStateException("Zero-length text nodes not allowed within document/element content"); } nextReceiver.characters(chars, locationId, properties); }
private Receiver getDestinationReceiver(Destination destination) throws SaxonApiException { Executable exec = expression.getExecutable(); PipelineConfiguration pipe = expression.getConfiguration().makePipelineConfiguration(); Receiver out = destination.getReceiver(pipe, exec.getPrimarySerializationProperties()); if (Configuration.isAssertionsEnabled()) { return new RegularSequenceChecker(out); } else { return out; } }
private Receiver getDestinationReceiver(Destination destination) throws SaxonApiException { Executable exec = expression.getExecutable(); PipelineConfiguration pipe = expression.getConfiguration().makePipelineConfiguration(); Receiver out = destination.getReceiver(pipe, exec.getPrimarySerializationProperties()); if (Configuration.isAssertionsEnabled()) { return new RegularSequenceChecker(out); } else { return out; } }
/** * Processing Instruction */ public void processingInstruction(String target, CharSequence data, Location locationId, int properties) throws XPathException { transition("pi"); nextReceiver.processingInstruction(target, data, locationId, properties); }
/** * Get a Receiver corresponding to the chosen Destination for the transformation * @param destination the destination for the results of this transformation * @return a receiver that sends the results to this destination * @throws SaxonApiException if anything goes wrong */ public Receiver getDestinationReceiver(XsltController controller, Destination destination) throws SaxonApiException { Receiver receiver; controller.setPrincipalDestination(destination); PipelineConfiguration pipe = controller.makePipelineConfiguration(); SerializationProperties params = controller.getExecutable().getPrimarySerializationProperties(); receiver = destination.getReceiver(pipe, params); if (Configuration.isAssertionsEnabled()) { receiver = new RegularSequenceChecker(receiver); } receiver.getPipelineConfiguration().setController(controller); if (baseOutputUriWasSet) { try { if (destination.getDestinationBaseURI() == null) { destination.setDestinationBaseURI(new URI(controller.getBaseOutputURI())); } } catch (URISyntaxException e) { // no action } } else if (destination.getDestinationBaseURI() != null) { controller.setBaseOutputURI(destination.getDestinationBaseURI().toASCIIString()); } receiver.setSystemId(controller.getBaseOutputURI()); return receiver; }
/** * Notify the start of an element * @param nameCode 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 provides information such as line number and system ID. * @param properties properties of the element node */ public void startElement(NodeName nameCode, SchemaType typeCode, Location location, int properties) throws XPathException { transition("startElement"); stack.push(1); nextReceiver.startElement(nameCode, typeCode, location, properties); } }
/** * Get a Receiver corresponding to the chosen Destination for the transformation * @param destination the destination for the results of this transformation * @return a receiver that sends the results to this destination * @throws SaxonApiException if anything goes wrong */ public Receiver getDestinationReceiver(XsltController controller, Destination destination) throws SaxonApiException { Receiver receiver; controller.setPrincipalDestination(destination); PipelineConfiguration pipe = controller.makePipelineConfiguration(); SerializationProperties params = controller.getExecutable().getPrimarySerializationProperties(); receiver = destination.getReceiver(pipe, params); if (Configuration.isAssertionsEnabled()) { receiver = new RegularSequenceChecker(receiver); } receiver.getPipelineConfiguration().setController(controller); if (baseOutputUriWasSet) { try { if (destination.getDestinationBaseURI() == null) { destination.setDestinationBaseURI(new URI(controller.getBaseOutputURI())); } } catch (URISyntaxException e) { // no action } } else if (destination.getDestinationBaseURI() != null) { controller.setBaseOutputURI(destination.getDestinationBaseURI().toASCIIString()); } receiver.setSystemId(controller.getBaseOutputURI()); return receiver; }
/** * Start of event stream */ public void open() throws XPathException { transition("open"); nextReceiver.open(); }
/** * Notify the start of the content, that is, the completion of all attributes and namespaces. * Note that the initial receiver of output from XSLT instructions will not receive this event, * it has to detect it itself. Note that this event is reported for every element even if it has * no attributes, no namespaces, and no content. */ public void startContent() throws XPathException { transition("startContent"); nextReceiver.startContent(); }
/** * Start of a document node. */ public void startDocument(int properties) throws XPathException { transition("startDocument"); stack.push(0); nextReceiver.startDocument(properties); }
/** * Output a comment */ public void comment(CharSequence chars, Location locationId, int properties) throws XPathException { transition("comment"); nextReceiver.comment(chars, locationId, properties); }
/** * Notify the end of a document node */ public void endDocument() throws XPathException { transition("endDocument"); if (stack.isEmpty() || stack.pop() != 0) { throw new IllegalStateException("Unmatched endDocument() call"); } nextReceiver.endDocument(); }
/** * Processing Instruction */ public void processingInstruction(String target, CharSequence data, Location locationId, int properties) throws XPathException { transition("pi"); nextReceiver.processingInstruction(target, data, locationId, properties); }
/** * End of element */ public void endElement() throws XPathException { transition("endElement"); if (stack.isEmpty() || stack.pop() != 1) { throw new IllegalStateException("Unmatched endElement() call"); } if (stack.isEmpty()) { state = State.Open; } nextReceiver.endElement(); }
/** * Notify the start of an element * @param nameCode 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 provides information such as line number and system ID. * @param properties properties of the element node */ public void startElement(NodeName nameCode, SchemaType typeCode, Location location, int properties) throws XPathException { transition("startElement"); stack.push(1); nextReceiver.startElement(nameCode, typeCode, location, properties); } }
/** * Character data (corresponding to a text node). For character data within content (that is, events occurring * when the startDocument / startElement stack is non-empty), character data events will never be consecutive * and will never be zero-length. */ public void characters(CharSequence chars, Location locationId, int properties) throws XPathException { transition("text"); if (chars.length() == 0 && !stack.isEmpty()) { throw new IllegalStateException("Zero-length text nodes not allowed within document/element content"); } nextReceiver.characters(chars, locationId, properties); }
/** * Start of event stream */ public void open() throws XPathException { transition("open"); nextReceiver.open(); }
/** * Output a comment */ public void comment(CharSequence chars, Location locationId, int properties) throws XPathException { transition("comment"); nextReceiver.comment(chars, locationId, properties); }
/** * Notify a namespace. Namespaces are notified <b>after</b> the startElement event, and before * any children for the element. The namespaces that are reported are only required * to include those that are different from the parent element; however, duplicates may be reported. * A namespace must not conflict with any namespaces already used for element or attribute names. * * @param namespaceBindings the namespace (prefix, uri) pair to be notified * @throws IllegalStateException: attempt to output a namespace when there is no open element * start tag */ public void namespace(NamespaceBindingSet namespaceBindings, int properties) throws XPathException { transition("namespace"); nextReceiver.namespace(namespaceBindings, properties); }
/** * Notify the end of a document node */ public void endDocument() throws XPathException { transition("endDocument"); if (stack.isEmpty() || stack.pop() != 0) { throw new IllegalStateException("Unmatched endDocument() call"); } nextReceiver.endDocument(); }