com.jclark.xsl.sax
Class NXMLOutputHandler

java.lang.Object
  extended by com.jclark.xsl.sax.NXMLOutputHandler
All Implemented Interfaces:
OutputDocumentHandler, org.xml.sax.DocumentHandler

public class NXMLOutputHandler
extends java.lang.Object
implements OutputDocumentHandler

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


Nested Class Summary
(package private)  class NXMLOutputHandler.CharacterHandler
           
(package private)  class NXMLOutputHandler.ControlCharacterHandler
           
(package private)  class NXMLOutputHandler.DataCharacterHandler
           
(package private)  class NXMLOutputHandler.EscapeCharacterHandler
           
(package private)  class NXMLOutputHandler.LineControlCharacterHandler
           
 
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)
          initialize with the given target destination and xsl:output attributes.
 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(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
Description copied from interface: OutputDocumentHandler
initialize with the given target destination and xsl:output attributes.

Specified by:
init in interface OutputDocumentHandler
Returns:
an initialized instance of this, ready to write to the destination
Throws:
java.io.IOException

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
Throws:
org.xml.sax.SAXException

ignorableWhitespace

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

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
Throws:
org.xml.sax.SAXException

endElement

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

pop

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


push

public void push(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
Throws:
org.xml.sax.SAXException

setDocumentLocator

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