com.icl.saxon.output

Class DocumentHandlerProxy

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

protected DocumentHandler
handler
protected AttributeListImpl
outputAtts

Fields inherited from class com.icl.saxon.output.Emitter

locator, namePool, outputProperties, outputStream, systemId, writer

Method Summary

void
characters(char[] chars, int start, int len)
Character data
void
comment(ch[] , int start, int length)
Output a comment
void
endDocument()
End of document
void
endElement(int nameCode)
End of element
void
processingInstruction(String target, String data)
Processing Instruction
void
setDocumentLocator(Locator locator)
Set Document Locator
void
setUnderlyingDocumentHandler(DocumentHandler handler)
Set the underlying document handler.
void
startDocument()
Start of document
void
startElement(int nameCode, Attributes attributes, int[] namespaces, int nscount)
Start of element

Methods inherited from class com.icl.saxon.output.Emitter

characters, comment, endDocument, endElement, getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, processingInstruction, setDocumentLocator, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setUnparsedEntity, setWriter, startDocument, startElement, usesWriter

Field Details

handler

protected DocumentHandler handler

outputAtts

protected AttributeListImpl outputAtts

Method Details

characters

public void characters(char[] chars,
                       int start,
                       int len)
            throws TransformerException
Character data
Overrides:
characters in interface Emitter

comment

public void comment(ch[] ,
                    int start,
                    int length)
Output a comment

endDocument

public void endDocument()
            throws TransformerException
End of document
Overrides:
endDocument in interface Emitter

endElement

public void endElement(int nameCode)
            throws TransformerException
End of element
Overrides:
endElement in interface Emitter

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws TransformerException
Processing Instruction
Overrides:
processingInstruction in interface Emitter

setDocumentLocator

public void setDocumentLocator(Locator locator)
Set Document Locator
Overrides:
setDocumentLocator in interface Emitter

setUnderlyingDocumentHandler

public void setUnderlyingDocumentHandler(DocumentHandler handler)
Set the underlying document handler. This call is mandatory before using the Emitter.

startDocument

public void startDocument()
            throws TransformerException
Start of document
Overrides:
startDocument in interface Emitter

startElement

public void startElement(int nameCode,
                         Attributes attributes,
                         int[] namespaces,
                         int nscount)
            throws TransformerException
Start of element
Overrides:
startElement in interface Emitter