net.sf.saxon.event
public class ContentHandlerProxy extends Object implements Receiver
This ContentHandlerProxy provides no access to type information. For a ContentHandler that makes type information available, see com.saxonica.jaxp.TypedContentHandler
The ContentHandlerProxy can also be nominated as a TraceListener, to receive notification of trace events. This will be done automatically if the option setTraceListener(Nested Class Summary | |
---|---|
class | ContentHandlerProxy.ContentHandlerProxyTraceListener
Create a TraceListener that will collect information about the current
location in the source document. |
Field Summary | |
---|---|
protected ContentHandler | handler |
protected LexicalHandler | lexicalHandler |
protected AttributeCollectionImpl | pendingAttributes |
Method Summary | |
---|---|
void | attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
Notify an attribute. |
void | characters(CharSequence chars, int locationId, int properties)
Character data |
void | close()
Notify the end of the event stream |
void | comment(CharSequence chars, int locationId, int properties)
Output a comment. |
void | endDocument()
Notify the end of the document |
void | endElement()
End of element |
Configuration | getConfiguration()
Get the Saxon configuration |
long | getCurrentLocationId()
Get the current location identifier |
LocationProvider | getLocationProvider()
Get the location provider |
PipelineConfiguration | getPipelineConfiguration()
Get the pipeline configuration |
String | getSystemId()
Get the System ID of the destination tree |
ContentHandlerProxy.ContentHandlerProxyTraceListener | getTraceListener()
Get the associated TraceListener that receives notification of trace events |
ContentHandler | getUnderlyingContentHandler()
Get the underlying content handler |
boolean | isRequireWellFormed()
Ask 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. |
boolean | isUndeclareNamespaces()
Ask whether namespace undeclaration events (for a non-null prefix) should be notified.
|
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.
|
void | open()
Notify the start of the event stream |
void | processingInstruction(String target, CharSequence data, int locationId, int properties)
Processing Instruction |
void | setLexicalHandler(LexicalHandler handler)
Set the Lexical Handler to be used. |
void | setOutputProperties(Properties details)
Set the output details. |
void | setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipeline configuration |
void | setRequireWellFormed(boolean wellFormed)
Set 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 | setSystemId(String systemId)
Set the System ID of the destination tree |
void | setUndeclareNamespaces(boolean undeclareNamespaces)
Set whether namespace undeclaration events (for a non-null prefix) should be notified.
|
void | setUnderlyingContentHandler(ContentHandler handler)
Set the underlying content handler. |
void | setUnparsedEntity(String name, String systemID, String publicID)
Notify an unparsed entity URI. |
void | startContent()
Notify the start of the content, that is, the completion of all attributes and namespaces.
|
void | startDocument(int properties)
Notify the start of the document. |
void | startElement(int nameCode, int typeCode, int locationId, int properties)
Notify the start of an element |
boolean | usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events |
Returns: the Saxon configuration
Returns: the location identifier of the most recent event. This can be translated to real location information by passing it to the location provider.
Returns: the location provider, used to map location ids to actual URIs and line numbers
Returns: the system ID (effectively the base URI)
Returns: the trace listener. If there is no existing trace listener, then a new one will be created.
Returns: the SAX content handler to which all events are being directed
Returns: true if the content handler requires the event stream to represent a well-formed XML document (containing exactly one top-level element node and no top-level text nodes)
Returns: true if namespace undeclarations (xmlns:p="") are to be output
Parameters: handler the SAX lexical handler to which lexical events (such as comments) will be notified.
Parameters: details the serialization properties. The only values used by this implementation are REQUIRE_WELL_FORMED and UNDECLARE_PREFIXES.
Parameters: pipe the pipeline configuration
Parameters: wellFormed set to true if the content handler requires the event stream to represent a well-formed XML document (containing exactly one top-level element node and no top-level text nodes). Otherwise, multiple top-level elements and text nodes are allowed, as in the XDM model.
Parameters: systemId the system ID (effectively the base URI)
Parameters: undeclareNamespaces true if namespace undeclarations (xmlns:p="") are to be output
Parameters: handler the SAX content handler to which all events will be directed
Parameters: name The name of the unparsed entity systemID The system identifier of the unparsed entity publicID The public identifier of the unparsed entity
Returns: true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation