com.icl.saxon.output
Interface Emitter

All Known Implementing Classes:
ContentHandlerProxy, FragmentValue, ErrorEmitter, XMLEmitter, ProxyEmitter, 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(Name name)
          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 setEscaping(boolean escaping)
          Switch escaping on or off.
 void setOutputDetails(OutputDetails details)
          Set output details.
 void setWriter(java.io.Writer writer)
          Set the Writer to be used.
 void startDocument()
          Notify document start
 void startElement(Name name, AttributeCollection attributes)
          Output an element start tag.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Start a namespace prefix mapping.
 

Method Detail

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(Name name,
                         AttributeCollection attributes)
                  throws org.xml.sax.SAXException
Output an element start tag.

endElement

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

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Start a namespace prefix mapping. All prefixes used in element or attribute names will be notified before the relevant startElement call. Note that there is no corresponding endPrefixMapping call: the Emitter is expected to keep track of namespace nesting itself.

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