Class XHTML5Emitter

All Implemented Interfaces:
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 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:
      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
    • writeDocTypeWithNullSystemId

      protected boolean writeDocTypeWithNullSystemId()
      Overrides:
      writeDocTypeWithNullSystemId in class XMLEmitter
    • writeEmptyElementTagCloser

      protected void writeEmptyElementTagCloser(String displayName, NodeName name) throws 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:
      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