com.jclark.xsl.sax

Class Indenter

Implemented Interfaces:
DocumentHandler, CommentHandler, OutputDocumentHandler, RawCharactersHandler

public class Indenter
extends java.lang.Object
implements OutputDocumentHandler, CommentHandler, RawCharactersHandler

performs "pretty-printing" by wrapping another OutputDocumentHandler, intercepting SAX events, and inserting whitespace events as appropriate. ... (Actually, I don't think it adds any indenting, just newlines)

Constructor Summary

Indenter(DocumentHandler handler, RawCharactersHandler rawCharactersHandler)

Method Summary

void
characters(ch[] , int start, int length)
void
comment(String contents)
void
endDocument()
void
endElement(String name)
void
ignorableWhitespace(ch[] , int start, int length)
DocumentHandler
init(Destination dest, AttributeList atts)
void
processingInstruction(String target, String data)
void
rawCharacters(String chars)
void
setDocumentLocator(Locator locator)
void
startDocument()
void
startElement(String name, AttributeList atts)

Constructor Details

Indenter

public Indenter(DocumentHandler handler,
                RawCharactersHandler rawCharactersHandler)

Method Details

characters

public void characters(ch[] ,
                       int start,
                       int length)
            throws SAXException

comment

public void comment(String contents)
            throws SAXException
Specified by:
comment in interface CommentHandler

endDocument

public void endDocument()
            throws SAXException

endElement

public void endElement(String name)
            throws SAXException

ignorableWhitespace

public void ignorableWhitespace(ch[] ,
                                int start,
                                int length)
            throws SAXException

init

public DocumentHandler init(Destination dest,
                            AttributeList atts)
            throws IOException,
                   SAXException
Specified by:
init in interface OutputDocumentHandler

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException

rawCharacters

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

setDocumentLocator

public void setDocumentLocator(Locator locator)

startDocument

public void startDocument()
            throws SAXException

startElement

public void startElement(String name,
                         AttributeList atts)
            throws SAXException