net.sf.saxon.event

Class ReceivingContentHandler

public class ReceivingContentHandler extends Object implements ContentHandler, LexicalHandler, DTDHandler, SaxonLocator

ReceivingContentHandler is a glue class that provides a standard SAX ContentHandler interface to a Saxon Receiver. To achieve this it needs to map names supplied as strings to numeric name codes, for which purpose it needs access to a name pool. The class also performs the function of assembling adjacent text nodes.

The class was previously named ContentEmitter.

Author: Michael H. Kay

Constructor Summary
ReceivingContentHandler()
create a ReceivingContentHandler and initialise variables
Method Summary
voidcharacters(char[] ch, int start, int length)
Callback interface for SAX: not for application use
voidcomment(char[] ch, int start, int length)
Callback interface for SAX (part of LexicalHandler interface): not for application use
voidendCDATA()
voidendDocument()
Callback interface for SAX: not for application use
voidendDTD()
Register the end of the DTD.
voidendElement(String uri, String localname, String rawname)
Callback interface for SAX: not for application use
voidendEntity(String name)
voidendPrefixMapping(String prefix)
Callback interface for SAX: not for application use
intgetColumnNumber()
Return the character position where the current document event ends.
ConfigurationgetConfiguration()
intgetLineNumber()
Return the line number where the current document event ends.
intgetLineNumber(int locationId)
PipelineConfigurationgetPipelineConfiguration()
StringgetPublicId()
Return the public identifier for the current document event.
StringgetSystemId()
Return the public identifier for the current document event.
StringgetSystemId(int locationId)
voidignorableWhitespace(char[] ch, int start, int length)
Callback interface for SAX: not for application use
booleanisIgnoringIgnorableWhitespace()
Determine whether "ignorable whitespace" is ignored.
voidnotationDecl(String name, String publicId, String systemId)
voidprocessingInstruction(String name, String remainder)
Callback interface for SAX: not for application use
voidreset()
Set the ReceivingContentHandler to its initial state, except for the local name cache, which is retained
voidsetDocumentLocator(Locator locator)
Callback interface for SAX: not for application use
voidsetIgnoreIgnorableWhitespace(boolean ignore)
Set whether "ignorable whitespace" should be ignored.
voidsetPipelineConfiguration(PipelineConfiguration pipe)
voidsetReceiver(Receiver e)
voidskippedEntity(String name)
voidstartCDATA()
voidstartDocument()
Callback interface for SAX: not for application use
voidstartDTD(String name, String publicId, String systemId)
Register the start of the DTD.
voidstartElement(String uri, String localname, String rawname, Attributes atts)
Callback interface for SAX: not for application use
voidstartEntity(String name)
voidstartPrefixMapping(String prefix, String uri)
Callback interface for SAX: not for application use
voidunparsedEntityDecl(String name, String publicId, String systemId, String notationName)

Constructor Detail

ReceivingContentHandler

public ReceivingContentHandler()
create a ReceivingContentHandler and initialise variables

Method Detail

characters

public void characters(char[] ch, int start, int length)
Callback interface for SAX: not for application use

comment

public void comment(char[] ch, int start, int length)
Callback interface for SAX (part of LexicalHandler interface): not for application use

endCDATA

public void endCDATA()

endDocument

public void endDocument()
Callback interface for SAX: not for application use

endDTD

public void endDTD()
Register the end of the DTD. Comments in the DTD are skipped because they are not part of the XPath data model

endElement

public void endElement(String uri, String localname, String rawname)
Callback interface for SAX: not for application use

endEntity

public void endEntity(String name)

endPrefixMapping

public void endPrefixMapping(String prefix)
Callback interface for SAX: not for application use

getColumnNumber

public int getColumnNumber()
Return the character position where the current document event ends.

Returns: The column number, or -1 if none is available.

getConfiguration

public Configuration getConfiguration()

getLineNumber

public int getLineNumber()
Return the line number where the current document event ends.

Returns: The line number, or -1 if none is available.

getLineNumber

public int getLineNumber(int locationId)

getPipelineConfiguration

public PipelineConfiguration getPipelineConfiguration()

getPublicId

public String getPublicId()
Return the public identifier for the current document event.

Returns: A string containing the public identifier, or null if none is available.

getSystemId

public String getSystemId()
Return the public identifier for the current document event.

Returns: A string containing the system identifier, or null if none is available.

getSystemId

public String getSystemId(int locationId)

ignorableWhitespace

public void ignorableWhitespace(char[] ch, int start, int length)
Callback interface for SAX: not for application use

isIgnoringIgnorableWhitespace

public boolean isIgnoringIgnorableWhitespace()
Determine whether "ignorable whitespace" is ignored. This returns the value that was set using ReceivingContentHandler if that has been called; otherwise the value from the configuration.

notationDecl

public void notationDecl(String name, String publicId, String systemId)

processingInstruction

public void processingInstruction(String name, String remainder)
Callback interface for SAX: not for application use

reset

public void reset()
Set the ReceivingContentHandler to its initial state, except for the local name cache, which is retained

setDocumentLocator

public void setDocumentLocator(Locator locator)
Callback interface for SAX: not for application use

setIgnoreIgnorableWhitespace

public void setIgnoreIgnorableWhitespace(boolean ignore)
Set whether "ignorable whitespace" should be ignored. This method is effective only if called after setPipelineConfiguration, since the default value is taken from the configuration.

setPipelineConfiguration

public void setPipelineConfiguration(PipelineConfiguration pipe)

setReceiver

public void setReceiver(Receiver e)

skippedEntity

public void skippedEntity(String name)

startCDATA

public void startCDATA()

startDocument

public void startDocument()
Callback interface for SAX: not for application use

startDTD

public void startDTD(String name, String publicId, String systemId)
Register the start of the DTD. Comments in the DTD are skipped because they are not part of the XPath data model

startElement

public void startElement(String uri, String localname, String rawname, Attributes atts)
Callback interface for SAX: not for application use

startEntity

public void startEntity(String name)

startPrefixMapping

public void startPrefixMapping(String prefix, String uri)
Callback interface for SAX: not for application use

unparsedEntityDecl

public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)