/** * Report character data classified as "Ignorable whitespace", that is, whitespace text nodes * appearing as children of elements with an element-only content model */ public void ignorableWhitespace(char ch[], int start, int length) { if (!ignoreIgnorable) { characters(ch, start, length); } }
/** * Callback interface for SAX: not for application use */ public void setDocumentLocator (final Locator locator) { // If the user has called setSystemId(), we use that system ID in preference to this one, // which probably comes from the XML parser possibly via some chain of SAX filters if (systemId == null) { super.setDocumentLocator(locator); } }
if (ch instanceof ReceivingContentHandler) { ce = (ReceivingContentHandler)ch; ce.reset(); } else { ce = new ReceivingContentHandler(); parser.setContentHandler(ce); parser.setDTDHandler(ce); ce.setReceiver(receiver); ce.setPipelineConfiguration(pipe);
flush(); if (!inDTD) { if (name==null) { comment(remainder.toCharArray(), 0, remainder.length()); } else { if (!getConfiguration().getNameChecker().isValidNCName(name)) { throw new SAXException("Invalid processing instruction name (" + name + ')'); flush(); escapingDisabled = true; return; } else if (name.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { flush(); escapingDisabled = false; return;
flush(); int nameCode = getNameCode(uri, localname, rawname); receiver.startElement(nameCode, StandardNames.XS_UNTYPED, 0, ReceiverOptions.NAMESPACE_OK); if (attributes2class == null) { try { attributes2class = getConfiguration().getClass("org.xml.sax.ext.Attributes2", false, null); int attCode = getNameCode(atts.getURI(a), atts.getLocalName(a), atts.getQName(a)); String type = atts.getType(a); int typeCode = StandardNames.XS_UNTYPED_ATOMIC;
/** * Notify the existence of a comment. Note that in SAX this is part of LexicalHandler interface * rather than the ContentHandler interface. */ public void comment (char ch[], int start, int length) throws SAXException { try { flush(); if (!inDTD) { receiver.comment(new CharSlice(ch, start, length), 0, 0); } } catch (XPathException err) { throw new SAXException(err); } }
/** * Get a ContentHandler that can be used to direct the output of a SAX parser (or other * source of SAX events) to this serializer. * * @return a newly constructed ContentHandler that pipes events into this Serializer * @throws SaxonApiException if any other failure occurs * @since 9.7 */ public org.xml.sax.ContentHandler getContentHandler() throws SaxonApiException { PipelineConfiguration pipe = processor.getUnderlyingConfiguration().makePipelineConfiguration(); Receiver r = getReceiver(pipe, getSerializationProperties()); //r = new SequenceNormalizerWithSpaceSeparator(r); r = new NamespaceReducer(r); ReceivingContentHandler rch = new ReceivingContentHandler(); rch.setReceiver(r); rch.setPipelineConfiguration(r.getPipelineConfiguration()); return rch; }
flush(true); NodeName elementName = getNodeName(uri, localname, rawname); receiver.startElement(elementName, Untyped.getInstance(), localLocator, ReceiverOptions.NAMESPACE_OK); NodeName attCode = getNodeName(atts.getURI(a), atts.getLocalName(a), atts.getQName(a)); String type = atts.getType(a); SimpleType typeCode = BuiltInAtomicType.UNTYPED_ATOMIC;
/** * Override the behaviour of endDocument() in ReceivingContentHandler, so that it fires off * the transformation of the constructed document */ public void endDocument() throws SAXException { super.endDocument(); DocumentInfo doc = (DocumentInfo)builder.getCurrentRoot(); if (doc==null) { throw new SAXException("No source document has been built"); } try { controller.transformDocument(doc, result); } catch (TransformerException err) { if (err instanceof XPathException) { controller.reportFatalError((XPathException)err); } throw new SAXException(err); } }
if (ch instanceof ReceivingContentHandler && config.isCompatible(((ReceivingContentHandler)ch).getConfiguration())) { ce = (ReceivingContentHandler)ch; ce.reset(); } else { ce = new ReceivingContentHandler(); parser.setContentHandler(ce); parser.setDTDHandler(ce); ce.setReceiver(receiver); ce.setPipelineConfiguration(pipe);
flush(); if (!inDTD) { if (name==null) { comment(remainder.toCharArray(), 0, remainder.length()); } else { if (!getConfiguration().getNameChecker().isValidNCName(name)) { throw new SAXException("Invalid processing instruction name (" + name + ')'); flush(); escapingDisabled = true; return; } else if (name.equals(Result.PI_ENABLE_OUTPUT_ESCAPING)) { flush(); escapingDisabled = false; return;
flush(); int nameCode = getNameCode(uri, localname, rawname); receiver.startElement(nameCode, StandardNames.XS_UNTYPED, 0, ReceiverOptions.NAMESPACE_OK); attributes2class = getConfiguration().getClass("org.xml.sax.ext.Attributes2", false, null); int attCode = getNameCode(atts.getURI(a), atts.getLocalName(a), atts.getQName(a)); String type = atts.getType(a); int typeCode = StandardNames.XS_UNTYPED_ATOMIC;
/** * Notify the existence of a comment. Note that in SAX this is part of LexicalHandler interface * rather than the ContentHandler interface. */ public void comment(char ch[], int start, int length) throws SAXException { try { flush(true); if (!inDTD) { receiver.comment(new CharSlice(ch, start, length), localLocator, 0); } } catch (XPathException err) { throw new SAXException(err); } }
/** * Get a ContentHandler that can be used to direct the output of a SAX parser (or other * source of SAX events) to this serializer. * * @return a newly constructed ContentHandler that pipes events into this Serializer * @throws SaxonApiException if any other failure occurs * @since 9.7 */ public org.xml.sax.ContentHandler getContentHandler() throws SaxonApiException { PipelineConfiguration pipe = processor.getUnderlyingConfiguration().makePipelineConfiguration(); Receiver r = getReceiver(pipe, getSerializationProperties()); //r = new SequenceNormalizerWithSpaceSeparator(r); r = new NamespaceReducer(r); ReceivingContentHandler rch = new ReceivingContentHandler(); rch.setReceiver(r); rch.setPipelineConfiguration(r.getPipelineConfiguration()); return rch; }
flush(true); NodeName elementName = getNodeName(uri, localname, rawname); receiver.startElement(elementName, Untyped.getInstance(), localLocator, ReceiverOptions.NAMESPACE_OK); NodeName attCode = getNodeName(atts.getURI(a), atts.getLocalName(a), atts.getQName(a)); String type = atts.getType(a); SimpleType typeCode = BuiltInAtomicType.UNTYPED_ATOMIC;
/** * Override the behaviour of endDocument() in ReceivingContentHandler, so that it fires off * the transformation of the constructed document */ public void endDocument() throws SAXException { super.endDocument(); DocumentInfo doc = (DocumentInfo)builder.getCurrentRoot(); builder.reset(); if (doc==null) { throw new SAXException("No source document has been built"); } try { controller.transformDocument(doc, result); } catch (TransformerException err) { if (err instanceof XPathException) { controller.reportFatalError((XPathException)err); } throw new SAXException(err); } }
if (ch instanceof ReceivingContentHandler && config.isCompatible(((ReceivingContentHandler) ch).getConfiguration())) { ce = (ReceivingContentHandler) ch; ce.reset(); } else { ce = new ReceivingContentHandler(); parser.setContentHandler(ce); parser.setDTDHandler(ce); ce.setReceiver(receiver); ce.setPipelineConfiguration(pipe);
flush(); if (!inDTD) { if (name==null) { comment(remainder.toCharArray(), 0, remainder.length()); } else { if (!getConfiguration().getNameChecker().isValidNCName(name)) { throw new SAXException("Invalid processing instruction name (" + name + ')');