Package net.sf.saxon.serialize
Class XHTML5Emitter
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.serialize.Emitter
net.sf.saxon.serialize.XMLEmitter
net.sf.saxon.serialize.XHTML5Emitter
- All Implemented Interfaces:
Result,Receiver,ReceiverWithOutputProperties
XHTML5Emitter is an Emitter that generates XHTML 5 output.
It is the same as XMLEmitter except that it follows the legacy HTML browser
compatibility rules: for example, generating empty elements such as [BR /], and
using [p][/p] for empty paragraphs rather than [p/]
-
Field Summary
Fields inherited from class net.sf.saxon.serialize.XMLEmitter
attSpecials, canonical, characterReferenceGenerator, declarationIsWritten, delimiter, DOCTYPE, elementCode, elementStack, indentForNextAttribute, internalSubset, openStartTag, RIGHT_ANGLE_NEWLINE, specialInAtt, specialInAttSingle, specialInText, started, startedElement, undeclareNamespaces, unfailingFields inherited from class net.sf.saxon.serialize.Emitter
allCharactersEncodable, characterSet, outputProperties, writerFields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(UnicodeString chars, Location locationId, int properties) Character data.protected voidwriteDocType(NodeName name, String displayName, String systemId, String publicId) Output the document type declarationprotected booleanprotected voidwriteEmptyElementTagCloser(String displayName, NodeName name) Close an empty element tag.Methods inherited from class net.sf.saxon.serialize.XMLEmitter
close, closeStartTag, comment, convertToAscii, endDocument, endElement, isStarted, namespace, open, openDocument, processingInstruction, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startDocument, startElement, testCharacters, usesTypeAnnotations, writeAttribute, writeAttributeIndentString, writeCodePoint, writeDeclaration, writeEscapeMethods inherited from class net.sf.saxon.serialize.Emitter
append, getOutputProperties, setMustClose, setOutputProperties, setUnicodeWriter, setUnparsedEntityMethods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, setPipelineConfiguration, setSystemIdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.event.Receiver
append, getPipelineConfiguration, handlesAppend, setPipelineConfigurationMethods inherited from interface javax.xml.transform.Result
getSystemId, setSystemId
-
Constructor Details
-
XHTML5Emitter
public XHTML5Emitter()
-
-
Method Details
-
writeDocType
protected void writeDocType(NodeName name, String displayName, String systemId, String publicId) throws XPathException Output the document type declaration- Overrides:
writeDocTypein classXMLEmitter- Parameters:
name- the qualified name of the elementdisplayName- The element name as displayedsystemId- The DOCTYPE system identifierpublicId- The DOCTYPE public identifier- Throws:
XPathException- if an error occurs writing to the output
-
writeDocTypeWithNullSystemId
protected boolean writeDocTypeWithNullSystemId()- Overrides:
writeDocTypeWithNullSystemIdin classXMLEmitter
-
writeEmptyElementTagCloser
Close an empty element tag.- Overrides:
writeEmptyElementTagCloserin classXMLEmitter- Parameters:
displayName- the name of the empty elementname- the fingerprint of the name of the empty element- Throws:
IOException- if an IO exception occurs
-
characters
public void characters(UnicodeString chars, Location locationId, int properties) throws XPathException Character data.- Specified by:
charactersin interfaceReceiver- Overrides:
charactersin classXMLEmitter- Parameters:
chars- The characterslocationId- provides information such as line number and system ID.properties- Bit significant value. The following bits are defined:- DISABLE_ESCAPING
- Disable escaping for this text node
- USE_CDATA
- Output as a CDATA section
- Throws:
XPathException- if an error occurs
-