com.icl.saxon.output
Class DOMEmitter

java.lang.Object
  |
  +--com.icl.saxon.output.DOMEmitter
All Implemented Interfaces:
Emitter

public class DOMEmitter
extends java.lang.Object
implements Emitter

DOMEmitter is an Emitter that attaches the result tree to a specified Node in a DOM Document


Field Summary
protected  org.w3c.dom.Node currentNode
           
protected  org.w3c.dom.Document document
           
protected  NamePool namePool
           
protected  OutputDetails outputDetails
           
 
Constructor Summary
DOMEmitter()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          Character data.
 void comment(char[] ch, int start, int length)
          Handle a comment.
 void endDocument()
          End of the document.
 void endElement(int nameCode)
          End of an element.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Handle a processing instruction.
 void setCharacterSet(CharacterSet charSet)
          Set the character set to use.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Set Document Locator.
 void setEscaping(boolean escaping)
          Set escaping on or off: ignored in this Emitter
 void setNamePool(NamePool pool)
          Set the name pool to be used for all name codes
 void setOutputDetails(OutputDetails details)
          Set output details
 void setUnparsedEntity(java.lang.String name, java.lang.String uri)
          Set the URI for an unparsed entity in the document.
 void setWriter(java.io.Writer writer)
          Set the Writer to use.
 void startDocument()
          Start of the document.
 void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount)
          Start of an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputDetails

protected OutputDetails outputDetails

currentNode

protected org.w3c.dom.Node currentNode

document

protected org.w3c.dom.Document document

namePool

protected NamePool namePool
Constructor Detail

DOMEmitter

public DOMEmitter()
Method Detail

setNamePool

public void setNamePool(NamePool pool)
Set the name pool to be used for all name codes
Specified by:
setNamePool in interface Emitter

setWriter

public void setWriter(java.io.Writer writer)
Set the Writer to use. Provided merely to satisfy the interface.
Specified by:
setWriter in interface Emitter

setCharacterSet

public void setCharacterSet(CharacterSet charSet)
Set the character set to use. Provided merely to satisfy the interface.
Specified by:
setCharacterSet in interface Emitter

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Set Document Locator. Provided merely to satisfy the interface.
Specified by:
setDocumentLocator in interface Emitter

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Start of the document.
Specified by:
startDocument in interface Emitter

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
End of the document.
Specified by:
endDocument in interface Emitter

startElement

public void startElement(int nameCode,
                         org.xml.sax.Attributes attributes,
                         int[] namespaces,
                         int nscount)
                  throws org.xml.sax.SAXException
Start of an element. Output the start tag, escaping special characters.
Specified by:
startElement in interface Emitter
Following copied from interface: com.icl.saxon.output.Emitter
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
End of an element.
Specified by:
endElement in interface Emitter

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Character data.
Specified by:
characters in interface Emitter

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Handle a processing instruction.
Specified by:
processingInstruction in interface Emitter

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws org.xml.sax.SAXException
Handle a comment.
Specified by:
comment in interface Emitter

setOutputDetails

public void setOutputDetails(OutputDetails details)
Set output details
Specified by:
setOutputDetails in interface Emitter
Following copied from interface: com.icl.saxon.output.Emitter
Parameters:
details - The details of the required output

setEscaping

public void setEscaping(boolean escaping)
Set escaping on or off: ignored in this Emitter
Specified by:
setEscaping in interface Emitter

setUnparsedEntity

public void setUnparsedEntity(java.lang.String name,
                              java.lang.String uri)
                       throws org.xml.sax.SAXException
Set the URI for an unparsed entity in the document.
Specified by:
setUnparsedEntity in interface Emitter