com.icl.saxon.output
Interface Emitter

All Known Implementing Classes:
Builder, ContentHandlerProxy, FragmentValue, ProxyEmitter, ErrorEmitter, XMLEmitter, DocumentHandlerProxy, DOMEmitter

public interface Emitter

Emitter: This interface defines methods that must be implemented by components that format SAXON output. There is one emitter for XML, one for HTML, and so on. Additional methods are concerned with setting options and providing a Writer.

The interface is deliberately designed to be as close as possible to the standard SAX DocumentHandler interface, however, it allows additional information to be made available.


Method Summary
 void characters(char[] chars, int start, int len)
          Output character data
 void comment(char[] chars, int start, int length)
          Output a comment.
 void endDocument()
          Notify document end
 void endElement(int nameCode)
          Output an element end tag
 void processingInstruction(java.lang.String name, java.lang.String data)
          Output a processing instruction
 void setCharacterSet(CharacterSet charset)
          Set the CharacterSet to be used.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Set locator, to identify position in the document.
 void setEscaping(boolean escaping)
          Switch escaping on or off.
 void setNamePool(NamePool namePool)
          Set the namePool in which all name codes can be found
 void setOutputDetails(OutputDetails details)
          Set output details.
 void setUnparsedEntity(java.lang.String name, java.lang.String uri)
          Set unparsed entity URI Used only when supplying input from a parser.
 void setWriter(java.io.Writer writer)
          Set the Writer to be used.
 void startDocument()
          Notify document start
 void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount)
          Output an element start tag.
 

Method Detail

setNamePool

public void setNamePool(NamePool namePool)
Set the namePool in which all name codes can be found

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Notify document start

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Notify document end

startElement

public void startElement(int nameCode,
                         org.xml.sax.Attributes attributes,
                         int[] namespaces,
                         int nscount)
                  throws org.xml.sax.SAXException
Output an element start tag.
Parameters:
namespaces - Array of namespace codes identifying the namespace prefix/uri pairs associated with this element
nscount - Number of significant entries within namespaces array

endElement

public void endElement(int nameCode)
                throws org.xml.sax.SAXException
Output an element end tag

characters

public void characters(char[] chars,
                       int start,
                       int len)
                throws org.xml.sax.SAXException
Output character data

processingInstruction

public void processingInstruction(java.lang.String name,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Output a processing instruction

comment

public void comment(char[] chars,
                    int start,
                    int length)
             throws org.xml.sax.SAXException
Output a comment.
(The method signature is borrowed from the SAX2 LexicalHandler interface)

setWriter

public void setWriter(java.io.Writer writer)
               throws org.xml.sax.SAXException
Set the Writer to be used. The writer will already be set up to perform any encoding requested. A writer will always be supplied before startDocument() is called.

setCharacterSet

public void setCharacterSet(CharacterSet charset)
                     throws org.xml.sax.SAXException
Set the CharacterSet to be used. The CharacterSet is a property of the encoding, it defines which characters are available in the output encoding. If no character set is supplied, the UnicodeCharacterSet should be assumed. It is the job of the emitter to provide a fallback representation of characters that the Writer cannot handle.

setEscaping

public void setEscaping(boolean escaping)
                 throws org.xml.sax.SAXException
Switch escaping on or off. This is called when the XSLT disable-output-escaping attribute is used to switch escaping on or off. It is also called at the start and end of a CDATA section It is not called for other sections of output (e.g. comments) where escaping is inappropriate.

setOutputDetails

public void setOutputDetails(OutputDetails details)
                      throws org.xml.sax.SAXException
Set output details. This supplies all the current output details to the emitter. Most of these are derived directly from the xsl:output or saxon:output element in the stylesheet.
Parameters:
details - The details of the required output

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Set locator, to identify position in the document. Used only when supplying input from a parser.

setUnparsedEntity

public void setUnparsedEntity(java.lang.String name,
                              java.lang.String uri)
                       throws org.xml.sax.SAXException
Set unparsed entity URI Used only when supplying input from a parser.