Package com.icl.saxon.output
Class DocumentHandlerProxy
- java.lang.Object
-
- com.icl.saxon.output.Emitter
-
- com.icl.saxon.output.DocumentHandlerProxy
-
- All Implemented Interfaces:
javax.xml.transform.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 org.xml.sax.DocumentHandlerhandlerprotected org.xml.sax.helpers.AttributeListImploutputAtts-
Fields inherited from class com.icl.saxon.output.Emitter
locator, namePool, outputProperties, outputStream, systemId, writer
-
-
Constructor Summary
Constructors Constructor Description DocumentHandlerProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] chars, int start, int len)Character datavoidcomment(char[] ch, int start, int length)Output a commentvoidendDocument()End of documentvoidendElement(int nameCode)End of elementvoidprocessingInstruction(java.lang.String target, java.lang.String data)Processing InstructionvoidsetDocumentLocator(org.xml.sax.Locator locator)Set Document LocatorvoidsetUnderlyingDocumentHandler(org.xml.sax.DocumentHandler handler)Set the underlying document handler.voidstartDocument()Start of documentvoidstartElement(int nameCode, org.xml.sax.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
-
-
-
-
Method Detail
-
setUnderlyingDocumentHandler
public void setUnderlyingDocumentHandler(org.xml.sax.DocumentHandler handler)
Set the underlying document handler. This call is mandatory before using the Emitter.
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
Set Document Locator- Overrides:
setDocumentLocatorin classEmitter
-
startDocument
public void startDocument() throws javax.xml.transform.TransformerExceptionStart of document- Specified by:
startDocumentin classEmitter- Throws:
javax.xml.transform.TransformerException
-
endDocument
public void endDocument() throws javax.xml.transform.TransformerExceptionEnd of document- Specified by:
endDocumentin classEmitter- Throws:
javax.xml.transform.TransformerException
-
startElement
public void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws javax.xml.transform.TransformerExceptionStart of element- Specified by:
startElementin classEmitternamespaces- Array of namespace codes identifying the namespace prefix/uri pairs associated with this elementnscount- Number of significant entries within namespaces array- Throws:
javax.xml.transform.TransformerException
-
endElement
public void endElement(int nameCode) throws javax.xml.transform.TransformerExceptionEnd of element- Specified by:
endElementin classEmitter- Throws:
javax.xml.transform.TransformerException
-
characters
public void characters(char[] chars, int start, int len) throws javax.xml.transform.TransformerExceptionCharacter data- Specified by:
charactersin classEmitter- Throws:
javax.xml.transform.TransformerException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws javax.xml.transform.TransformerExceptionProcessing Instruction- Specified by:
processingInstructionin classEmitter- Throws:
javax.xml.transform.TransformerException
-
-