com.icl.saxon.output
Class ContentHandlerProxy
- Locator, Result
public class ContentHandlerProxy
implements Locator
A ContentHandlerProxy is an Emitter that filters data before passing it to an
underlying SAX2 ContentHandler. Relevant events (notably comments) can also be
fed to a LexicalHandler.
Note that in general the output passed to an Emitter
corresponds to an External General Parsed Entity. A SAX2 ContentHandler only expects
to deal with well-formed XML documents, so we only pass it the contents of the first
element encountered.
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
|
int | getColumnNumber()
|
int | getLineNumber()
|
String | getPublicId()
|
protected void | notifyNotWellFormed() - The following function notifies the content handler, by means of a processing
instruction, that the output is not a well-formed document.
|
void | processingInstruction(String target, String data) - Processing Instruction
|
void | setDocumentLocator(Locator locator) - Set Document Locator
|
void | setEscaping(boolean escaping) - Switch escaping on or off.
|
void | setLexicalHandler(LexicalHandler handler) - Set the Lexical Handler to be used.
|
void | setRequireWellFormed(boolean wellFormed) - Indicate whether the content handler can handle a stream of events that is merely
well-balanced, or whether it can only handle a well-formed sequence.
|
void | setUnderlyingContentHandler(ContentHandler handler) - Set the underlying content handler.
|
void | startDocument() - Start of document
|
void | startElement(int nameCode, Attributes atts, int[] namespaces, int nscount) - Start of element
|
characters , comment , endDocument , endElement , getNamePool , getOutputProperties , getOutputStream , getSystemId , getWriter , makeEmitter , processingInstruction , setDocumentLocator , setEscaping , setNamePool , setOutputProperties , setOutputStream , setSystemId , setUnparsedEntity , setWriter , startDocument , startElement , usesWriter |
handler
protected ContentHandler handler
lexicalHandler
protected LexicalHandler lexicalHandler
locator
protected Locator locator
requireWellFormed
protected boolean requireWellFormed
characters
public void characters(char[] chars,
int start,
int len)
throws TransformerException
Character data
- characters in interface Emitter
comment
public void comment(ch[] ,
int start,
int length)
throws TransformerException
Output a comment. Passes it on to the ContentHandler provided that the ContentHandler
is also a SAX2 LexicalHandler.
endDocument
public void endDocument()
throws TransformerException
End of document
- endDocument in interface Emitter
endElement
public void endElement(int nameCode)
throws TransformerException
End of element
- endElement in interface Emitter
getColumnNumber
public int getColumnNumber()
getLineNumber
public int getLineNumber()
getPublicId
public String getPublicId()
notifyNotWellFormed
protected void notifyNotWellFormed()
throws SAXException
The following function notifies the content handler, by means of a processing
instruction, that the output is not a well-formed document. If the content
handler responds with an exception containing the message "continue"
(this is the only way it can get information back) then further events are
notified, otherwise they are suppressed.
processingInstruction
public void processingInstruction(String target,
String data)
throws TransformerException
Processing Instruction
- processingInstruction in interface Emitter
setDocumentLocator
public void setDocumentLocator(Locator locator)
Set Document Locator
- setDocumentLocator in interface Emitter
setEscaping
public void setEscaping(boolean escaping)
Switch escaping on or off. This is called when the XSLT disable-output-escaping attribute
is used to switch escaping on or off. It is not called for other sections of output (e.g.
element names) where escaping is inappropriate. The action, as defined in JAXP 1.1, is
to notify the request to the Content Handler using a processing instruction.
- setEscaping in interface Emitter
setLexicalHandler
public void setLexicalHandler(LexicalHandler handler)
Set the Lexical Handler to be used. If called, this must be called AFTER
setUnderlyingContentHandler()
setRequireWellFormed
public void setRequireWellFormed(boolean wellFormed)
Indicate whether the content handler can handle a stream of events that is merely
well-balanced, or whether it can only handle a well-formed sequence.
setUnderlyingContentHandler
public void setUnderlyingContentHandler(ContentHandler handler)
Set the underlying content handler. This call is mandatory before using the Emitter.
startDocument
public void startDocument()
throws TransformerException
Start of document
- startDocument in interface Emitter
startElement
public void startElement(int nameCode,
Attributes atts,
int[] namespaces,
int nscount)
throws TransformerException
Start of element
- startElement in interface Emitter