public class HTMLEmitter extends XMLEmitter
locator, namePool, outputProperties, outputStream, systemId, writerPI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPINGcharacterSet, declarationIsWritten, empty, escaping, lastDisplayName, lastNameCode, lastPrefix, lastURI, openStartTag, preferHex| Constructor | Description |
|---|---|
HTMLEmitter() |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
characters(char[] ch,
int start,
int length) |
Character data.
|
void |
endElement(int nameCode) |
Output an element end tag.
|
protected static boolean |
isEmptyTag(java.lang.String tag) |
|
static boolean |
isUrlAttribute(java.lang.String element,
java.lang.String attribute) |
|
void |
processingInstruction(java.lang.String target,
java.lang.String data) |
Handle a processing instruction.
|
void |
startDocument() |
Output start of document
|
void |
startElement(int nameCode,
org.xml.sax.Attributes atts,
int[] namespaces,
int nscount) |
Output element start tag
|
protected void |
writeAttribute(int elCode,
java.lang.String attname,
java.lang.String type,
java.lang.String value) |
Write attribute name=value pair.
|
protected void |
writeEscape(char[] ch,
int start,
int length,
boolean inAttribute) |
Escape characters.
|
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setNamePool, setOutputStream, setSystemId, setWriter, usesWriterclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseStartTag, comment, emptyElementTagCloser, endDocument, outputCharacterReference, setDocumentLocator, setEscaping, setOutputProperties, setResult, setUnparsedEntity, testCharacters, testCharacters, writeDeclaration, writeDocTypeprotected static boolean isEmptyTag(java.lang.String tag)
public static boolean isUrlAttribute(java.lang.String element,
java.lang.String attribute)
public void startDocument()
throws javax.xml.transform.TransformerException
startDocument in class XMLEmitterjavax.xml.transform.TransformerExceptionpublic void startElement(int nameCode,
org.xml.sax.Attributes atts,
int[] namespaces,
int nscount)
throws javax.xml.transform.TransformerException
startElement in class XMLEmitternamespaces - Array of namespace codes identifying the namespace prefix/uri
pairs associated with this elementnscount - Number of significant entries within namespaces arrayjavax.xml.transform.TransformerExceptionprotected void writeAttribute(int elCode,
java.lang.String attname,
java.lang.String type,
java.lang.String value)
throws javax.xml.transform.TransformerException
writeAttribute in class XMLEmitterjavax.xml.transform.TransformerExceptionprotected void writeEscape(char[] ch,
int start,
int length,
boolean inAttribute)
throws java.io.IOException
writeEscape in class XMLEmitterch - 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.java.io.IOExceptionpublic void endElement(int nameCode)
throws javax.xml.transform.TransformerException
endElement in class XMLEmittername - The element name (tag)javax.xml.transform.TransformerExceptionpublic void characters(char[] ch,
int start,
int length)
throws javax.xml.transform.TransformerException
characters in class XMLEmitterjavax.xml.transform.TransformerExceptionpublic void processingInstruction(java.lang.String target,
java.lang.String data)
throws javax.xml.transform.TransformerException
processingInstruction in class XMLEmitterjavax.xml.transform.TransformerException