/** * 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); }
/** * 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); } }
/** * 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); }
/** * 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); }
/** * 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); } }
/** * Output a comment */ public void comment(CharSequence chars, Location locationId, int properties) throws XPathException { transition("comment"); nextReceiver.comment(chars, locationId, 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(); }
/** * 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); }
/** * 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(); }
/** * 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); }
/** * 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 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); }