com.jclark.xsl.sax2

Class NXMLOutputHandler

Implemented Interfaces:
ContentHandler, OutputContentHandler

public class NXMLOutputHandler
extends java.lang.Object
implements OutputContentHandler

an output handler that recognizes our special technique for signalling 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(String namespaceURI, String localName, String qName)
void
endPrefixMapping(String prefix)
void
ignorableWhitespace(char[] ch, int off, int len)
ContentHandler
init(Destination dest, Properties props)
void
pop()
pops a character handler off the stack, reverting to previous (does this need to be public?)
void
processingInstruction(String target, 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
skippedEntity(String entityName)
void
startDocument()
SAX startDocument parse event
void
startElement(String namespaceURI, String localName, String qName, Attributes atts)
captures "control", "data", "char" and "escape" character indicators and interposes the appropriate character handler
void
startPrefixMapping(String prefix, String namespaceURI)

Constructor Details

NXMLOutputHandler

public NXMLOutputHandler()

Method Details

characters

public void characters(char[] ch,
                       int off,
                       int len)
            throws SAXException
SAX characters event -- send the characters to our current handler

endDocument

public void endDocument()
            throws SAXException
flush the output

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
            throws SAXException

endPrefixMapping

public void endPrefixMapping(String prefix)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int off,
                                int len)
            throws SAXException

init

public ContentHandler init(Destination dest,
                           Properties props)
            throws IOException
Specified by:
init in interface OutputContentHandler
Returns:
an initialized instance of this, ready to write to the Destination with the output options specified in props

pop

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

processingInstruction

public void processingInstruction(String target,
                                  String data)
SAX Processing Instruction event handler -- strips PI's from output

push

public void push(NXMLOutputHandler.CharacterHandler handler)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator loc)

skippedEntity

public void skippedEntity(String entityName)

startDocument

public void startDocument()
SAX startDocument parse event

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
            throws SAXException
captures "control", "data", "char" and "escape" character indicators and interposes the appropriate character handler

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String namespaceURI)