public abstract class HTMLEmitter extends XMLEmitter
Modifier and Type | Field and Description |
---|---|
protected int |
version |
characterReferenceGenerator, declarationIsWritten, elementCode, elementStack, indentForNextAttribute, openStartTag, started, startedElement, undeclareNamespaces
allCharactersEncodable, characterSet, namePool, outputProperties, outputStream, pipelineConfig, streamResult, systemId, writer
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
Constructor and Description |
---|
HTMLEmitter()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
characters(CharSequence chars,
int locationId,
int properties)
Character data.
|
void |
endElement()
Output an element end tag.
|
protected static boolean |
isEmptyTag(String tag) |
protected abstract boolean |
isHTMLElement(NodeName name)
Decide whether an element is "serialized as an HTML element" in the language of the 3.0 specification
|
void |
open()
Output start of document
|
protected void |
openDocument()
Do the real work of starting the document.
|
void |
processingInstruction(String target,
CharSequence data,
int locationId,
int properties)
Handle a processing instruction.
|
protected static void |
setEmptyTag(String tag) |
void |
setEscapeNonAscii(Boolean escape)
Say that all non-ASCII characters should be escaped, regardless of the character encoding
|
void |
startContent()
Notify the start of the content, that is, the completion of all attributes and namespaces.
|
void |
startElement(NodeName elemName,
SchemaType typeCode,
int locationId,
int properties)
Output element start tag
|
protected void |
writeAttribute(NodeName elCode,
String attname,
CharSequence value,
int properties)
Write attribute name=value pair.
|
protected void |
writeDocType(NodeName name,
String displayName,
String systemId,
String publicId)
Output the document type declaration
|
protected void |
writeEscape(CharSequence chars,
boolean inAttribute)
Escape characters.
|
attribute, close, closeStartTag, comment, emptyElementTagCloser, endDocument, getAttributeIndentString, namespace, setCharacterReferenceGenerator, setIndentForNextAttribute, startDocument, testCharacters, usesTypeAnnotations, writeCharSequence, writeDeclaration, writeDocTypeWithNullSystemId
getConfiguration, getOutputProperties, getOutputStream, getPipelineConfiguration, getSystemId, getWriter, makeOutputStream, makeWriter, setOutputProperties, setOutputStream, setPipelineConfiguration, setStreamResult, setSystemId, setUnparsedEntity, setWriter, usesWriter
protected static void setEmptyTag(String tag)
protected static boolean isEmptyTag(String tag)
public void setEscapeNonAscii(Boolean escape)
setEscapeNonAscii
in class XMLEmitter
escape
- true if all non ASCII characters should be escapedprotected abstract boolean isHTMLElement(NodeName name)
public void open() throws XPathException
open
in interface Receiver
open
in class XMLEmitter
XPathException
- if an error occursprotected void openDocument() throws XPathException
XMLEmitter
openDocument
in class XMLEmitter
XPathException
- f an error occurs opening the output fileprotected void writeDocType(NodeName name, String displayName, String systemId, String publicId) throws XPathException
writeDocType
in class XMLEmitter
displayName
- The element namesystemId
- The DOCTYPE system identifierpublicId
- The DOCTYPE public identifiername
- the qualified name of the elementXPathException
- if an error occurs writing to the outputpublic void startElement(NodeName elemName, SchemaType typeCode, int locationId, int properties) throws XPathException
startElement
in interface Receiver
startElement
in class XMLEmitter
elemName
- the name of the element.typeCode
- the type annotation of the element.locationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- bit-significant properties of the element node. If there are no revelant
properties, zero is supplied. The definitions of the bits are in class ReceiverOptions
XPathException
- if an error occurspublic void startContent() throws XPathException
Receiver
startContent
in interface Receiver
startContent
in class XMLEmitter
XPathException
- if an error occursprotected void writeAttribute(NodeName elCode, String attname, CharSequence value, int properties) throws XPathException
writeAttribute
in class XMLEmitter
elCode
- The element name is not used in this version of the
method, but is used in the HTML subclass.attname
- The attribute name, which has already been validated to ensure
it can be written in this encodingvalue
- The value of the attributeproperties
- Any special properties of the attributeXPathException
- if an error occursprotected void writeEscape(CharSequence chars, boolean inAttribute) throws IOException, XPathException
writeEscape
in class XMLEmitter
chars
- The character sequence containing the stringinAttribute
- Set to true if the text is in an attribute valueIOException
XPathException
public void endElement() throws XPathException
endElement
in interface Receiver
endElement
in class XMLEmitter
XPathException
- if an error occurspublic void characters(CharSequence chars, int locationId, int properties) throws XPathException
characters
in interface Receiver
characters
in class XMLEmitter
chars
- The characterslocationId
- an integer which can be interpreted using a LocationProvider
to return information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- Bit significant value. The following bits are defined:
XPathException
- if an error occurspublic void processingInstruction(String target, CharSequence data, int locationId, int properties) throws XPathException
processingInstruction
in interface Receiver
processingInstruction
in class XMLEmitter
target
- The PI name. This must be a legal name (it will not be checked).data
- The data portion of the processing instructionlocationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- Additional information about the PI.XPathException
- if an error occursCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.