com.jclark.xsl.sax

Class XMLOutputHandler

Implemented Interfaces:
DocumentHandler, CommentHandler, OutputDocumentHandler, RawCharactersHandler

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

A DocumentHandler that writes an XML representation to an OutputStream.

Field Summary

static byte
MINIMIZE_EMPTY_ELEMENTS
static byte
MINIMIZE_EMPTY_ELEMENTS_HTML
static byte
MINIMIZE_NONE

Constructor Summary

XMLOutputHandler()
Create a XMLOutputHandler that will write in UTF-8 to an OutputStream.
XMLOutputHandler(OutputStream out)

Method Summary

protected void
attributeValue(String value)
void
characters(cbuf[] , int off, int len)
void
comment(String body)
void
endDocument()
void
endElement(String name)
void
ignorableWhitespace(ch[] , int start, int length)
DocumentHandler
init(Destination dest, AttributeList atts)
void
markup(String chars)
void
processingInstruction(String target, String data)
void
rawCharacters(String chars)
void
setDocumentLocator(Locator loc)
void
setMinimize(byte minimize)
void
startDocument()
void
startElement(String name, AttributeList atts)

Field Details

MINIMIZE_EMPTY_ELEMENTS

public static final byte MINIMIZE_EMPTY_ELEMENTS
Field Value:
1

MINIMIZE_EMPTY_ELEMENTS_HTML

public static final byte MINIMIZE_EMPTY_ELEMENTS_HTML
Field Value:
2

MINIMIZE_NONE

public static final byte MINIMIZE_NONE
Field Value:
0

Constructor Details

XMLOutputHandler

public XMLOutputHandler()
Create a XMLOutputHandler that will write in UTF-8 to an OutputStream.

XMLOutputHandler

public XMLOutputHandler(OutputStream out)

Method Details

attributeValue

protected void attributeValue(String value)
            throws SAXException

characters

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

comment

public void comment(String body)
            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
Specified by:
init in interface OutputDocumentHandler

markup

public void markup(String chars)
            throws SAXException

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

setMinimize

public void setMinimize(byte minimize)

startDocument

public void startDocument()
            throws SAXException

startElement

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