Package com.icl.saxon.output
Class HTMLEmitter
- java.lang.Object
-
- com.icl.saxon.output.Emitter
-
- com.icl.saxon.output.XMLEmitter
-
- com.icl.saxon.output.HTMLEmitter
-
- All Implemented Interfaces:
Result
public class HTMLEmitter extends XMLEmitter
This class generates HTML output
-
-
Field Summary
-
Fields inherited from class com.icl.saxon.output.XMLEmitter
characterSet, declarationIsWritten, empty, escaping, lastDisplayName, lastNameCode, lastPrefix, lastURI, openStartTag, preferHex
-
Fields inherited from class com.icl.saxon.output.Emitter
locator, namePool, outputProperties, outputStream, systemId, writer
-
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
-
Constructor Summary
Constructors Constructor Description HTMLEmitter()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Character data.voidendElement(int nameCode)Output an element end tag.protected static booleanisEmptyTag(String tag)static booleanisUrlAttribute(String element, String attribute)voidprocessingInstruction(String target, String data)Handle a processing instruction.voidstartDocument()Output start of documentvoidstartElement(int nameCode, Attributes atts, int[] namespaces, int nscount)Output element start tagprotected voidwriteAttribute(int elCode, String attname, String type, String value)Write attribute name=value pair.protected voidwriteEscape(char[] ch, int start, int length, boolean inAttribute)Escape characters.-
Methods inherited from class com.icl.saxon.output.XMLEmitter
closeStartTag, comment, emptyElementTagCloser, endDocument, outputCharacterReference, setDocumentLocator, setEscaping, setOutputProperties, setResult, setUnparsedEntity, testCharacters, testCharacters, writeDeclaration, writeDocType
-
Methods inherited from class com.icl.saxon.output.Emitter
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setNamePool, setOutputStream, setSystemId, setWriter, usesWriter
-
-
-
-
Method Detail
-
isEmptyTag
protected static boolean isEmptyTag(String tag)
-
startDocument
public void startDocument() throws TransformerExceptionOutput start of document- Overrides:
startDocumentin classXMLEmitter- Throws:
TransformerException
-
startElement
public void startElement(int nameCode, Attributes atts, int[] namespaces, int nscount) throws TransformerExceptionOutput element start tag- Overrides:
startElementin classXMLEmitternamespaces- Array of namespace codes identifying the namespace prefix/uri pairs associated with this elementnscount- Number of significant entries within namespaces array- Throws:
TransformerException
-
writeAttribute
protected void writeAttribute(int elCode, String attname, String type, String value) throws TransformerExceptionWrite 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:
writeAttributein classXMLEmitter- Throws:
TransformerException
-
writeEscape
protected void writeEscape(char[] ch, int start, int length, boolean inAttribute) throws IOExceptionEscape characters. Overrides the XML behaviour- Overrides:
writeEscapein classXMLEmitter- Parameters:
ch- The character array containing the stringstart- The start position of the input string within the character arraylength- The length of the input string within the character array This method converts the XML special characters (such as < and &) into their predefined entities.- Throws:
IOException
-
endElement
public void endElement(int nameCode) throws TransformerExceptionOutput an element end tag.- Overrides:
endElementin classXMLEmitter- Parameters:
name- The element name (tag)- Throws:
TransformerException
-
characters
public void characters(char[] ch, int start, int length) throws TransformerExceptionCharacter data.- Overrides:
charactersin classXMLEmitter- Throws:
TransformerException
-
processingInstruction
public void processingInstruction(String target, String data) throws TransformerException
Handle a processing instruction.- Overrides:
processingInstructionin classXMLEmitter- Throws:
TransformerException
-
-