com.jclark.xsl.sax2

Class OutputMethodDefaulter

Implemented Interfaces:
ContentHandler, CommentHandler, RawCharactersHandler

public class OutputMethodDefaulter
extends java.lang.Object
implements ContentHandler, CommentHandler, RawCharactersHandler

automagically decides to use the html output method if the first start element name is "html" in no namespace

Recieves SAX parse events from a ResultBase, till it gets a look at the root element's name.

Tells the ResultBase that had been sending it SAX parse events what this has learned. The result base will switch to an appropriate ContentHandler. This then sends any events it has queued up while waiting to see the root element name, then is never used again during the transform.

Nested Class Summary

(package private) static class
OutputMethodDefaulter.CharactersEvent
(package private) static class
OutputMethodDefaulter.CommentEvent
(package private) static class
OutputMethodDefaulter.Event
(package private) static class
OutputMethodDefaulter.IgnorableWhitespaceEvent
(package private) static class
OutputMethodDefaulter.ProcessingInstructionEvent
(package private) static class
OutputMethodDefaulter.RawCharactersEvent

Constructor Summary

OutputMethodDefaulter(ResultBase result, OutputMethod outputMethod)
Construct with the guy who's gonna be sending us events and whatever the stylesheet's told us about the output parameters

Method Summary

void
characters(char[] buf, int off, int len)
void
comment(String content)
void
endDocument()
receive notice of doc's end
void
endElement(String namespaceURI, String localName, String qName)
receive notice of an element's end ...
void
endPrefixMapping(String prefix)
void
ignorableWhitespace(char[] buf, int off, int len)
void
processingInstruction(String target, String content)
void
rawCharacters(String chars)
void
setDocumentLocator(Locator loc)
void
skippedEntity(String name)
void
startDocument()
receive notice of doc's start
void
startElement(String namespaceURI, String localName, String qName, Attributes atts)
the first start element, if it's "html" and in no namespace, then we switch to an html contentHandler -- yucchh
void
startPrefixMapping(String prefix, String namespace)

Constructor Details

OutputMethodDefaulter

(package private)  OutputMethodDefaulter(ResultBase result,
                                         OutputMethod outputMethod)
Construct with the guy who's gonna be sending us events and whatever the stylesheet's told us about the output parameters

Method Details

characters

public void characters(char[] buf,
                       int off,
                       int len)
            throws SAXException


comment

public void comment(String content)
Specified by:
comment in interface CommentHandler


endDocument

public void endDocument()
            throws SAXException
receive notice of doc's end


endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
receive notice of an element's end ... this should never happen, because we should have routed all events to another ContentHandler upon getting the first startElement()


endPrefixMapping

public void endPrefixMapping(String prefix)


ignorableWhitespace

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


processingInstruction

public void processingInstruction(String target,
                                  String content)


rawCharacters

public void rawCharacters(String chars)
Specified by:
rawCharacters in interface RawCharactersHandler


setDocumentLocator

public void setDocumentLocator(Locator loc)


skippedEntity

public void skippedEntity(String name)


startDocument

public void startDocument()
receive notice of doc's start


startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
            throws SAXException
the first start element, if it's "html" and in no namespace, then we switch to an html contentHandler -- yucchh


startPrefixMapping

public void startPrefixMapping(String prefix,
                               String namespace)