net.sf.saxon.event

Class HTMLEmitter

public class HTMLEmitter extends XMLEmitter

This class generates HTML output

Author: Michael H. Kay

Field Summary
static HTMLTagHashSetemptyTags
Table of HTML tags that have no closing tag
Constructor Summary
HTMLEmitter()
Constructor
Method Summary
voidcharacters(CharSequence chars, int locationId, int properties)
Character data.
voidendElement()
Output an element end tag.
protected static booleanisEmptyTag(String tag)
voidopen()
Output start of document
protected voidopenDocument()
voidprocessingInstruction(String target, CharSequence data, int locationId, int properties)
Handle a processing instruction.
voidstartContent()
voidstartElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag
protected voidwriteAttribute(int elCode, String attname, CharSequence value, int properties)
Write attribute name=value pair.
protected voidwriteEscape(CharSequence chars, boolean inAttribute)
Escape characters.

Field Detail

emptyTags

static HTMLTagHashSet emptyTags
Table of HTML tags that have no closing tag

Constructor Detail

HTMLEmitter

public HTMLEmitter()
Constructor

Method Detail

characters

public void characters(CharSequence chars, int locationId, int properties)
Character data.

endElement

public void endElement()
Output an element end tag.

isEmptyTag

protected static boolean isEmptyTag(String tag)

open

public void open()
Output start of document

openDocument

protected void openDocument()

processingInstruction

public void processingInstruction(String target, CharSequence data, int locationId, int properties)
Handle a processing instruction.

startContent

public void startContent()

startElement

public void startElement(int nameCode, int typeCode, int locationId, int properties)
Output element start tag

writeAttribute

protected void writeAttribute(int elCode, String attname, CharSequence value, int properties)
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.

writeEscape

protected void writeEscape(CharSequence chars, boolean inAttribute)
Escape characters. Overrides the XML behaviour