Package com.icl.saxon.output
Class DocumentHandlerProxy
- java.lang.Object
-
- com.icl.saxon.output.Emitter
-
- com.icl.saxon.output.DocumentHandlerProxy
-
- All Implemented Interfaces:
Result
public class DocumentHandlerProxy extends Emitter
A DocumentHandlerProxy is an Emitter that filters data before passing it to an underlying SAX DocumentHandler. Note that in general the output passed to an Emitter corresponds to an External General Parsed Entity. A SAX DocumentHandler only expects to deal with well-formed XML documents, so we only pass it the contents of the first element encountered.
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentHandler
handler
protected AttributeListImpl
outputAtts
-
Fields inherited from class com.icl.saxon.output.Emitter
locator, namePool, outputProperties, outputStream, systemId, writer
-
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
-
Constructor Summary
Constructors Constructor Description DocumentHandlerProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] chars, int start, int len)
Character datavoid
comment(char[] ch, int start, int length)
Output a commentvoid
endDocument()
End of documentvoid
endElement(int nameCode)
End of elementvoid
processingInstruction(String target, String data)
Processing Instructionvoid
setDocumentLocator(Locator locator)
Set Document Locatorvoid
setUnderlyingDocumentHandler(DocumentHandler handler)
Set the underlying document handler.void
startDocument()
Start of documentvoid
startElement(int nameCode, Attributes attributes, int[] namespaces, int nscount)
Start of element-
Methods inherited from class com.icl.saxon.output.Emitter
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setUnparsedEntity, setWriter, usesWriter
-
-
-
-
Field Detail
-
handler
protected DocumentHandler handler
-
outputAtts
protected AttributeListImpl outputAtts
-
-
Method Detail
-
setUnderlyingDocumentHandler
public void setUnderlyingDocumentHandler(DocumentHandler handler)
Set the underlying document handler. This call is mandatory before using the Emitter.
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
Set Document Locator- Overrides:
setDocumentLocator
in classEmitter
-
startDocument
public void startDocument() throws TransformerException
Start of document- Specified by:
startDocument
in classEmitter
- Throws:
TransformerException
-
endDocument
public void endDocument() throws TransformerException
End of document- Specified by:
endDocument
in classEmitter
- Throws:
TransformerException
-
startElement
public void startElement(int nameCode, Attributes attributes, int[] namespaces, int nscount) throws TransformerException
Start of element- Specified by:
startElement
in classEmitter
namespaces
- Array of namespace codes identifying the namespace prefix/uri pairs associated with this elementnscount
- Number of significant entries within namespaces array- Throws:
TransformerException
-
endElement
public void endElement(int nameCode) throws TransformerException
End of element- Specified by:
endElement
in classEmitter
- Throws:
TransformerException
-
characters
public void characters(char[] chars, int start, int len) throws TransformerException
Character data- Specified by:
characters
in classEmitter
- Throws:
TransformerException
-
processingInstruction
public void processingInstruction(String target, String data) throws TransformerException
Processing Instruction- Specified by:
processingInstruction
in classEmitter
- Throws:
TransformerException
-
-