com.icl.saxon
Class ContentEmitter

java.lang.Object
  extended bycom.icl.saxon.ContentEmitter
All Implemented Interfaces:
ContentHandler, DTDHandler, LexicalHandler
Direct Known Subclasses:
IdentityTransformerHandler, TemplatesHandlerImpl, TransformerHandlerImpl

public class ContentEmitter
extends Object
implements ContentHandler, LexicalHandler, DTDHandler

ContentEmitter is a glue class that provides a standard SAX ContentHandler interface to a Saxon Emitter. 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.

Author:
Michael H. Kay (mhkay@iclway.co.uk)

Constructor Summary
ContentEmitter()
          create a ContentEmitter and initialise variables
 
Method Summary
 void characters(char[] ch, int start, int length)
          Callback interface for SAX: not for application use
 void comment(char[] ch, int start, int length)
          Callback interface for SAX (part of LexicalHandler interface): not for application use
 void endCDATA()
           
 void endDocument()
          Callback interface for SAX: not for application use
 void endDTD()
          Register the end of the DTD.
 void endElement(String uri, String localname, String rawname)
          Callback interface for SAX: not for application use
 void endEntity(String name)
           
 void endPrefixMapping(String prefix)
          Callback interface for SAX: not for application use
 void ignorableWhitespace(char[] ch, int start, int length)
          Callback interface for SAX: not for application use
 void notationDecl(String name, String publicId, String systemId)
           
 void processingInstruction(String name, String remainder)
          Callback interface for SAX: not for application use
 void setDocumentLocator(Locator locator)
          Callback interface for SAX: not for application use
 void setEmitter(Emitter e)
           
 void setNamePool(NamePool namePool)
           
 void skippedEntity(String name)
           
 void startCDATA()
           
 void startDocument()
          Callback interface for SAX: not for application use
 void startDTD(String name, String publicId, String systemId)
          Register the start of the DTD.
 void startElement(String uri, String localname, String rawname, Attributes atts)
          Callback interface for SAX: not for application use
 void startEntity(String name)
           
 void startPrefixMapping(String prefix, String uri)
          Callback interface for SAX: not for application use
 void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentEmitter

public ContentEmitter()
create a ContentEmitter and initialise variables

Method Detail

setEmitter

public void setEmitter(Emitter e)

setNamePool

public void setNamePool(NamePool namePool)

startDocument

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

Specified by:
startDocument in interface ContentHandler
Throws:
SAXException

endDocument

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

Specified by:
endDocument in interface ContentHandler
Throws:
SAXException

setDocumentLocator

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

Specified by:
setDocumentLocator in interface ContentHandler

startPrefixMapping

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

Specified by:
startPrefixMapping in interface ContentHandler

endPrefixMapping

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

Specified by:
endPrefixMapping in interface ContentHandler

startElement

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

Specified by:
startElement in interface ContentHandler
Throws:
SAXException

endElement

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

Specified by:
endElement in interface ContentHandler
Throws:
SAXException

characters

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

Specified by:
characters in interface ContentHandler

ignorableWhitespace

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

Specified by:
ignorableWhitespace in interface ContentHandler

processingInstruction

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

Specified by:
processingInstruction in interface ContentHandler
Throws:
SAXException

comment

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

Specified by:
comment in interface LexicalHandler
Throws:
SAXException

skippedEntity

public void skippedEntity(String name)
Specified by:
skippedEntity in interface ContentHandler

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

Specified by:
startDTD in interface LexicalHandler

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

Specified by:
endDTD in interface LexicalHandler

startEntity

public void startEntity(String name)
Specified by:
startEntity in interface LexicalHandler

endEntity

public void endEntity(String name)
Specified by:
endEntity in interface LexicalHandler

startCDATA

public void startCDATA()
Specified by:
startCDATA in interface LexicalHandler

endCDATA

public void endCDATA()
Specified by:
endCDATA in interface LexicalHandler

notationDecl

public void notationDecl(String name,
                         String publicId,
                         String systemId)
Specified by:
notationDecl in interface DTDHandler

unparsedEntityDecl

public void unparsedEntityDecl(String name,
                               String publicId,
                               String systemId,
                               String notationName)
                        throws SAXException
Specified by:
unparsedEntityDecl in interface DTDHandler
Throws:
SAXException