net.sf.saxon.event

Class HTMLEmitter

Implemented Interfaces:
Result, Receiver

public class HTMLEmitter
extends XMLEmitter

This class generates HTML output
Author:
Michael H. Kay

Field Summary

Fields inherited from class net.sf.saxon.event.XMLEmitter

declarationIsWritten, elementCode, elementStack, empty, openStartTag, preferHex, undeclareNamespaces

Fields inherited from class net.sf.saxon.event.Emitter

allCharactersEncodable, characterSet, namePool, outputProperties, outputStream, pipelineConfig, streamResult, systemId, writer

Constructor Summary

HTMLEmitter()
Constructor

Method Summary

void
characters(CharSequence chars, int locationId, int properties)
Character data.
void
endElement()
Output an element end tag.
protected static boolean
isEmptyTag(String tag)
void
open()
Output start of document
protected void
openDocument()
void
processingInstruction(String target, CharSequence data, int locationId, int properties)
Handle a processing instruction.
void
startContent()
void
startElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag
protected void
writeAttribute(int elCode, String attname, CharSequence value, int properties)
Write attribute name=value pair.
protected void
writeEscape(CharSequence chars, boolean inAttribute)
Escape characters.

Methods inherited from class net.sf.saxon.event.XMLEmitter

attribute, characters, close, closeStartTag, comment, emptyElementTagCloser, endDocument, endElement, namespace, open, openDocument, outputCharacterReference, processingInstruction, startContent, startDocument, startElement, testCharacters, writeAttribute, writeCharSequence, writeDeclaration, writeDocType, writeEscape

Methods inherited from class net.sf.saxon.event.Emitter

getConfiguration, getOutputProperties, getOutputStream, getPipelineConfiguration, getSystemId, getWriter, makeWriter, setOutputProperties, setOutputStream, setPipelineConfiguration, setStreamResult, setSystemId, setUnparsedEntity, setWriter, usesWriter

Constructor Details

HTMLEmitter

public HTMLEmitter()
Constructor

Method Details

characters

public void characters(CharSequence chars,
                       int locationId,
                       int properties)
            throws XPathException
Character data.
Specified by:
characters in interface Receiver
Overrides:
characters in interface XMLEmitter

endElement

public void endElement()
            throws XPathException
Output an element end tag.
Specified by:
endElement in interface Receiver
Overrides:
endElement in interface XMLEmitter

isEmptyTag

protected static boolean isEmptyTag(String tag)

open

public void open()
            throws XPathException
Output start of document
Specified by:
open in interface Receiver
Overrides:
open in interface XMLEmitter

openDocument

protected void openDocument()
            throws XPathException
Overrides:
openDocument in interface XMLEmitter

processingInstruction

public void processingInstruction(String target,
                                  CharSequence data,
                                  int locationId,
                                  int properties)
            throws XPathException
Handle a processing instruction.
Specified by:
processingInstruction in interface Receiver
Overrides:
processingInstruction in interface XMLEmitter

startContent

public void startContent()
            throws XPathException
Specified by:
startContent in interface Receiver
Overrides:
startContent in interface XMLEmitter

startElement

public void startElement(int nameCode,
                         int typeCode,
                         int locationId,
                         int properties)
            throws XPathException
Output element start tag
Specified by:
startElement in interface Receiver
Overrides:
startElement in interface XMLEmitter

writeAttribute

protected void writeAttribute(int elCode,
                              String attname,
                              CharSequence value,
                              int properties)
            throws XPathException
Write attribute name=value pair. Overrides the XML behaviour if the name and value are the same (we assume this is a boolean attribute to be minimised), or if the value is a URL.
Overrides:
writeAttribute in interface XMLEmitter

writeEscape

protected void writeEscape(CharSequence chars,
                           boolean inAttribute)
            throws java.io.IOException,
                   XPathException
Escape characters. Overrides the XML behaviour
Overrides:
writeEscape in interface XMLEmitter