com.jclark.xsl.sax2

Class XMLOutputHandler

Implemented Interfaces:
ContentHandler, CommentHandler, OutputContentHandler, RawCharactersHandler

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

A ContentHandler 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 namespace, String localName, String qName)
void
endPrefixMapping(String prefix)
void
ignorableWhitespace(ch[] , int start, int length)
ContentHandler
init(Destination dest, Properties props)
return this intialized for writing to the output represented by dest with the output parameters found in props.
void
markup(String chars)
void
processingInstruction(String target, String data)
void
rawCharacters(String chars)
void
setDocumentLocator(Locator loc)
void
setMinimize(byte minimize)
void
skippedEntity(String name)
void
startDocument()
void
startElement(String namespace, String localName, String qName, Attributes atts)
void
startPrefixMapping(String prefix, String namespaceURI)

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 namespace,
                       String localName,
                       String qName)
            throws SAXException


endPrefixMapping

public void endPrefixMapping(String prefix)


ignorableWhitespace

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


init

public ContentHandler init(Destination dest,
                           Properties props)
            throws IOException
return this intialized for writing to the output represented by dest with the output parameters found in props.
Specified by:
init in interface OutputContentHandler


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)


skippedEntity

public void skippedEntity(String name)


startDocument

public void startDocument()
            throws SAXException


startElement

public void startElement(String namespace,
                         String localName,
                         String qName,
                         Attributes atts)
            throws SAXException


startPrefixMapping

public void startPrefixMapping(String prefix,
                               String namespaceURI)