| java.lang.Object net.sf.saxon.event.Emitter net.sf.saxon.event.ContentHandlerProxy
All known Subclasses: net.sf.saxon.dom.TypedContentHandler,
ContentHandlerProxy | public class ContentHandlerProxy extends Emitter implements Locator(Code) | | 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, unless the saxon:require-well-formed output property is set to "no".
This ContentHandlerProxy provides no access to type information. For a ContentHandler that
makes type information available, see
net.sf.saxon.dom.TypedContentHandler |
Method Summary | |
public void | attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) Notify an attribute. | public void | characters(CharSequence chars, int locationId, int properties) | public void | close() | public void | comment(CharSequence chars, int locationId, int properties) Output a comment. | public void | endDocument() | public void | endElement() | public int | getColumnNumber() | public int | getLineNumber() | public String | getPublicId() | public String | getSystemId() | public ContentHandler | getUnderlyingContentHandler() | public boolean | isRequireWellFormed() Determine 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. | public boolean | isUndeclareNamespaces() Determine whether namespace undeclaration events (for a non-null prefix) should be notified.
The default is no, because some ContentHandlers (e.g. | public void | namespace(int namespaceCode, int properties) Notify a namespace. | protected void | notifyNotWellFormed() The following function is called when it is found that the output is not a well-formed document. | public void | open() | public void | processingInstruction(String target, CharSequence data, int locationId, int properties) | public void | setLexicalHandler(LexicalHandler handler) Set the Lexical Handler to be used. | public void | setOutputProperties(Properties details) Set the output details. | public void | setPipelineConfiguration(PipelineConfiguration config) | 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. | public void | setUndeclareNamespaces(boolean undeclareNamespaces) Determine whether namespace undeclaration events (for a non-null prefix) should be notified.
The default is no, because some ContentHandlers (e.g. | public void | setUnderlyingContentHandler(ContentHandler handler) Set the underlying content handler. | public void | startContent() Notify the start of the content, that is, the completion of all attributes and namespaces.
Note that the initial receiver of output from XSLT instructions will not receive this event,
it has to detect it itself. | public void | startDocument(int properties) Start of a document node. | public void | startElement(int nameCode, int typeCode, int locationId, int properties) |
attribute | public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) throws XPathException(Code) | | Notify an attribute. Attributes are notified after the startElement event, and before any
children.
|
comment | public void comment(CharSequence chars, int locationId, int properties) throws XPathException(Code) | | Output a comment. Passes it on to the ContentHandler provided that the ContentHandler
is also a SAX2 LexicalHandler.
|
getColumnNumber | public int getColumnNumber()(Code) | | Get the column number
-1 (always) |
getLineNumber | public int getLineNumber()(Code) | | Get the line number
the line number giving the location of the most recent event notified |
getPublicId | public String getPublicId()(Code) | | Get the Public ID
null (always) |
getSystemId | public String getSystemId()(Code) | | Get the System ID
the system ID giving the location of the most recent event notified |
getUnderlyingContentHandler | public ContentHandler getUnderlyingContentHandler()(Code) | | Get the underlying content handler
|
isRequireWellFormed | public boolean isRequireWellFormed()(Code) | | Determine 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.
|
isUndeclareNamespaces | public boolean isUndeclareNamespaces()(Code) | | Determine whether namespace undeclaration events (for a non-null prefix) should be notified.
The default is no, because some ContentHandlers (e.g. JDOM) can't cope with them.
true if namespace undeclarations (xmlns:p="") are output |
namespace | public void namespace(int namespaceCode, int properties) throws XPathException(Code) | | Notify a namespace. Namespaces are notified after the startElement event, and before
any children for the element.
|
notifyNotWellFormed | protected void notifyNotWellFormed() throws XPathException(Code) | | The following function is called when it is found that the output is not a well-formed document.
Unless the ContentHandler accepts "balanced content", this is a fatal error.
|
setLexicalHandler | public void setLexicalHandler(LexicalHandler handler)(Code) | | Set the Lexical Handler to be used. If called, this must be called AFTER
setUnderlyingContentHandler()
|
setRequireWellFormed | public void setRequireWellFormed(boolean wellFormed)(Code) | | 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.
|
setUndeclareNamespaces | public void setUndeclareNamespaces(boolean undeclareNamespaces)(Code) | | Determine whether namespace undeclaration events (for a non-null prefix) should be notified.
The default is no, because some ContentHandlers (e.g. JDOM) can't cope with them.
Parameters: undeclareNamespaces - true if namespace undeclarations (xmlns:p="") are to be output |
setUnderlyingContentHandler | public void setUnderlyingContentHandler(ContentHandler handler)(Code) | | Set the underlying content handler. This call is mandatory before using the Emitter.
|
startContent | public void startContent() throws XPathException(Code) | | Notify the start of the content, that is, the completion of all attributes and namespaces.
Note that the initial receiver of output from XSLT instructions will not receive this event,
it has to detect it itself. Note that this event is reported for every element even if it has
no attributes, no namespaces, and no content.
|
startDocument | public void startDocument(int properties) throws XPathException(Code) | | Start of a document node.
|
startElement | public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException(Code) | | Notify the start of an element
|
|
|