com.jclark.xsl.sax
Class NXMLOutputHandler

java.lang.Object
  |
  +--com.jclark.xsl.sax.NXMLOutputHandler
All Implemented Interfaces:
org.xml.sax.DocumentHandler, OutputDocumentHandler

public class NXMLOutputHandler
extends java.lang.Object
implements OutputDocumentHandler

an output handler that handles our special technique for non XML characters


Constructor Summary
NXMLOutputHandler()
           
 
Method Summary
 void characters(char[] ch, int off, int len)
          SAX characters event -- send the characters to our current handler
 void endDocument()
          flush the output
 void endElement(java.lang.String name)
           
 void ignorableWhitespace(char[] ch, int off, int len)
           
 org.xml.sax.DocumentHandler init(Destination dest, org.xml.sax.AttributeList atts)
           
 void pop()
          pops a character handler off the stack, reverting to previous (does this need to be public?)
 void processingInstruction(java.lang.String target, java.lang.String data)
          SAX Processing Instruction event handler -- strips PI's from output
 void push(com.jclark.xsl.sax.NXMLOutputHandler.CharacterHandler handler)
           
 void setDocumentLocator(org.xml.sax.Locator loc)
           
 void startDocument()
          SAX startDocument parse event
 void startElement(java.lang.String name, org.xml.sax.AttributeList atts)
          captures "control", "data", "char" and "escape" character indicators and interposes the appropriate character handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NXMLOutputHandler

public NXMLOutputHandler()
Method Detail

init

public org.xml.sax.DocumentHandler init(Destination dest,
                                        org.xml.sax.AttributeList atts)
                                 throws java.io.IOException
Specified by:
init in interface OutputDocumentHandler
Returns:
an initialized instance of this, ready to write to the destination

startDocument

public void startDocument()
SAX startDocument parse event
Specified by:
startDocument in interface org.xml.sax.DocumentHandler

characters

public void characters(char[] ch,
                       int off,
                       int len)
                throws org.xml.sax.SAXException
SAX characters event -- send the characters to our current handler
Specified by:
characters in interface org.xml.sax.DocumentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int off,
                                int len)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.DocumentHandler

startElement

public void startElement(java.lang.String name,
                         org.xml.sax.AttributeList atts)
                  throws org.xml.sax.SAXException
captures "control", "data", "char" and "escape" character indicators and interposes the appropriate character handler
Specified by:
startElement in interface org.xml.sax.DocumentHandler

endElement

public void endElement(java.lang.String name)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.DocumentHandler

pop

public void pop()
pops a character handler off the stack, reverting to previous (does this need to be public?)

push

public void push(com.jclark.xsl.sax.NXMLOutputHandler.CharacterHandler handler)

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
SAX Processing Instruction event handler -- strips PI's from output
Specified by:
processingInstruction in interface org.xml.sax.DocumentHandler

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
flush the output
Specified by:
endDocument in interface org.xml.sax.DocumentHandler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator loc)
Specified by:
setDocumentLocator in interface org.xml.sax.DocumentHandler