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:
javax.xml.transform.Result,Receiver,ReceiverWithOutputProperties
public class XHTML5Emitter extends XMLEmitter
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, elementCode, elementStack, indentForNextAttribute, openStartTag, started, startedElement, undeclareNamespaces, unfailing
-
Fields inherited from class net.sf.saxon.serialize.Emitter
allCharactersEncodable, characterSet, outputProperties, outputStream, streamResult, writer
-
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
-
-
Constructor Summary
Constructors Constructor Description XHTML5Emitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(java.lang.CharSequence chars, Location locationId, int properties)Character data.protected java.lang.StringemptyElementTagCloser(java.lang.String displayName, NodeName name)Close an empty element tag.protected voidwriteDocType(NodeName name, java.lang.String displayName, java.lang.String systemId, java.lang.String publicId)Output the document type declarationprotected booleanwriteDocTypeWithNullSystemId()-
Methods inherited from class net.sf.saxon.serialize.XMLEmitter
close, closeStartTag, comment, convertToAscii, endDocument, endElement, getAttributeIndentString, isStarted, namespace, open, openDocument, processingInstruction, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startDocument, startElement, testCharacters, usesTypeAnnotations, writeAttribute, writeCharSequence, writeDeclaration, writeEscape
-
Methods inherited from class net.sf.saxon.serialize.Emitter
append, getOutputProperties, getOutputStream, getWriter, makeOutputStream, makeWriter, setOutputProperties, setOutputStream, setStreamResult, setUnparsedEntity, setWriter, usesWriter
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, setPipelineConfiguration, setSystemId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.event.Receiver
append, getPipelineConfiguration, handlesAppend, setPipelineConfiguration, setSystemId
-
-
-
-
Method Detail
-
writeDocType
protected void writeDocType(NodeName name, java.lang.String displayName, java.lang.String systemId, java.lang.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
-
emptyElementTagCloser
protected java.lang.String emptyElementTagCloser(java.lang.String displayName, NodeName name)Close an empty element tag.- Overrides:
emptyElementTagCloserin classXMLEmitter- Parameters:
displayName- the name of the empty elementname- the fingerprint of the name of the empty element- Returns:
- the string used to close an empty element tag.
-
characters
public void characters(java.lang.CharSequence chars, Location locationId, int properties) throws XPathExceptionCharacter 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
-
-