Class 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/]
    • Constructor Detail

      • XHTML5Emitter

        public XHTML5Emitter()
    • 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:
        writeDocType in class XMLEmitter
        Parameters:
        name - the qualified name of the element
        displayName - The element name as displayed
        systemId - The DOCTYPE system identifier
        publicId - The DOCTYPE public identifier
        Throws:
        XPathException - if an error occurs writing to the output
      • writeEmptyElementTagCloser

        protected void writeEmptyElementTagCloser​(java.lang.String displayName,
                                                  NodeName name)
                                           throws java.io.IOException
        Close an empty element tag.
        Overrides:
        writeEmptyElementTagCloser in class XMLEmitter
        Parameters:
        displayName - the name of the empty element
        name - the fingerprint of the name of the empty element
        Throws:
        java.io.IOException - if an IO exception occurs
      • characters

        public void characters​(UnicodeString chars,
                               Location locationId,
                               int properties)
                        throws XPathException
        Character data.
        Specified by:
        characters in interface Receiver
        Overrides:
        characters in class XMLEmitter
        Parameters:
        chars - The characters
        locationId - 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