|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.icl.saxon.output.Emitter com.icl.saxon.output.ContentHandlerProxy
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.
Field Summary | |
protected org.xml.sax.ContentHandler |
handler
|
protected org.xml.sax.ext.LexicalHandler |
lexicalHandler
|
protected org.xml.sax.Locator |
locator
|
protected boolean |
requireWellFormed
|
Fields inherited from class com.icl.saxon.output.Emitter |
namePool, outputProperties, outputStream, systemId, writer |
Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
ContentHandlerProxy()
|
Method Summary | |
void |
characters(char[] chars,
int start,
int len)
Character data |
void |
comment(char[] ch,
int start,
int length)
Output a comment. |
void |
endDocument()
End of document |
void |
endElement(int nameCode)
End of element |
int |
getColumnNumber()
|
int |
getLineNumber()
|
java.lang.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(java.lang.String target,
java.lang.String data)
Processing Instruction |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Set Document Locator |
void |
setEscaping(boolean escaping)
Switch escaping on or off. |
void |
setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
Set the Lexical Handler to be used. |
void |
setOutputProperties(java.util.Properties props)
Set the output properties |
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(org.xml.sax.ContentHandler handler)
Set the underlying content handler. |
void |
startDocument()
Start of document |
void |
startElement(int nameCode,
org.xml.sax.Attributes atts,
int[] namespaces,
int nscount)
Start of element |
Methods inherited from class com.icl.saxon.output.Emitter |
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setNamePool, setOutputStream, setSystemId, setUnparsedEntity, setWriter, usesWriter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.Locator |
getSystemId |
Field Detail |
protected org.xml.sax.ContentHandler handler
protected org.xml.sax.ext.LexicalHandler lexicalHandler
protected org.xml.sax.Locator locator
protected boolean requireWellFormed
Constructor Detail |
public ContentHandlerProxy()
Method Detail |
public void setUnderlyingContentHandler(org.xml.sax.ContentHandler handler)
public void setOutputProperties(java.util.Properties props)
setOutputProperties
in class Emitter
public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
public void setRequireWellFormed(boolean wellFormed)
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in class Emitter
public void startDocument() throws TransformerException
startDocument
in class Emitter
TransformerException
public void endDocument() throws TransformerException
endDocument
in class Emitter
TransformerException
public void startElement(int nameCode, org.xml.sax.Attributes atts, int[] namespaces, int nscount) throws TransformerException
startElement
in class Emitter
namespaces
- Array of namespace codes identifying the namespace prefix/uri
pairs associated with this elementnscount
- Number of significant entries within namespaces array
TransformerException
public void endElement(int nameCode) throws TransformerException
endElement
in class Emitter
TransformerException
public void characters(char[] chars, int start, int len) throws TransformerException
characters
in class Emitter
TransformerException
protected void notifyNotWellFormed() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws TransformerException
processingInstruction
in class Emitter
TransformerException
public void comment(char[] ch, int start, int length) throws TransformerException
comment
in class Emitter
TransformerException
public void setEscaping(boolean escaping)
setEscaping
in class Emitter
public java.lang.String getPublicId()
getPublicId
in interface org.xml.sax.Locator
public int getLineNumber()
getLineNumber
in interface org.xml.sax.Locator
public int getColumnNumber()
getColumnNumber
in interface org.xml.sax.Locator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |