com.jclark.xsl.sax2

Class OutputMethodDefaulter

public class OutputMethodDefaulter extends 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
static classOutputMethodDefaulter.CharactersEvent
static classOutputMethodDefaulter.CommentEvent
abstract static classOutputMethodDefaulter.Event
static classOutputMethodDefaulter.IgnorableWhitespaceEvent
static classOutputMethodDefaulter.ProcessingInstructionEvent
static classOutputMethodDefaulter.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
voidcharacters(char[] buf, int off, int len)
voidcomment(String content)
voidendDocument()
receive notice of doc's end
voidendElement(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()
voidendPrefixMapping(String prefix)
voidignorableWhitespace(char[] buf, int off, int len)
voidprocessingInstruction(String target, String content)
voidrawCharacters(String chars)
voidsetDocumentLocator(Locator loc)
voidskippedEntity(String name)
voidstartDocument()
receive notice of doc's start
voidstartElement(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
voidstartPrefixMapping(String prefix, String namespace)

Constructor Detail

OutputMethodDefaulter

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 Detail

characters

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

comment

public void comment(String content)

endDocument

public void endDocument()
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)

processingInstruction

public void processingInstruction(String target, String content)

rawCharacters

public void rawCharacters(String chars)

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)
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)