Package net.sf.saxon.serialize

## Class HTML40Emitter

- java.lang.Object
- - net.sf.saxon.event.SequenceReceiver
  - - net.sf.saxon.serialize.Emitter
    - - net.sf.saxon.serialize.XMLEmitter
      - - net.sf.saxon.serialize.HTMLEmitter
        - - net.sf.saxon.serialize.HTML40Emitter

- All Implemented Interfaces:
    `javax.xml.transform.Result`, `Receiver`, `ReceiverWithOutputProperties`

      public class HTML40Emitter
      extends HTMLEmitter

  This class generates HTML 4.0 output

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.serialize.HTMLEmitter

      `version`

    - ### 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`

    - ### Fields inherited from interface javax.xml.transform.Result

      `PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HTML40Emitter()` | Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `isHTMLElement​(NodeName name)` | Decide whether an element is "serialized as an HTML element" in the language of the 3.0 specification
    `protected void` | `openDocument()` | Do the real work of starting the document.
    `protected boolean` | `rejectControlCharacters()` | Ask whether control characters should be rejected: true for HTML4, false for HTML5
    `void` | `startElement​(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties)` | Output element start tag

    - ### Methods inherited from class net.sf.saxon.serialize.HTMLEmitter

      `characters, emptyElementTagCloser, endElement, isEmptyTag, open, processingInstruction, setEmptyTag, setEscapeNonAscii, startContentOLD, writeAttribute, writeDocType, writeEscape`

    - ### Methods inherited from class net.sf.saxon.serialize.XMLEmitter

      `close, closeStartTag, comment, convertToAscii, endDocument, getAttributeIndentString, isStarted, namespace, setCharacterReferenceGenerator, setIndentForNextAttribute, startDocument, testCharacters, usesTypeAnnotations, writeCharSequence, writeDeclaration, writeDocTypeWithNullSystemId`

    - ### 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`

    - ### Methods inherited from interface javax.xml.transform.Result

      `getSystemId`

- - ### Constructor Detail

    - #### HTML40Emitter

          public HTML40Emitter()

      Constructor

  - ### Method Detail

    - #### isHTMLElement

          protected boolean isHTMLElement​(NodeName name)

      Decide whether an element is "serialized as an HTML element" in the language of the 3.0 specification
      Specified by:
        `isHTMLElement` in class `HTMLEmitter`
      Returns:
        true if the element is to be serialized as an HTML element

    - #### openDocument

          protected void openDocument()
                               throws XPathException

      Description copied from class: `XMLEmitter`
      Do the real work of starting the document. This happens when the first content is written.
      Overrides:
        `openDocument` in class `HTMLEmitter`
      Throws:
        `XPathException` - if an error occurs opening the output file

    - #### startElement

          public void startElement​(NodeName elemName,
                                   SchemaType type,
                                   AttributeMap attributes,
                                   NamespaceMap namespaces,
                                   Location location,
                                   int properties)
                            throws XPathException

      Output element start tag
      Specified by:
        `startElement` in interface `Receiver`
      Overrides:
        `startElement` in class `HTMLEmitter`
      Parameters:
        `elemName` -
        `type` -
        `attributes` -
        `namespaces` -
        `location` -
        `properties` -
      Throws:
        `XPathException` - if an error occurs

    - #### rejectControlCharacters

          protected boolean rejectControlCharacters()

      Ask whether control characters should be rejected: true for HTML4, false for HTML5
      Specified by:
        `rejectControlCharacters` in class `HTMLEmitter`
      Returns:
        true if control characters should be rejected