Package net.sf.saxon.serialize

## Class TEXTEmitter

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

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

      public class TEXTEmitter
      extends XMLEmitter

  This class generates TEXT output

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

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

      `PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `characters​(java.lang.CharSequence chars, Location locationId, int properties)` | Produce output using the current Writer.
    `void` | `comment​(java.lang.CharSequence chars, Location locationId, int properties)` | Output a comment.
    `void` | `endElement()` | Output an element end tag.
    `void` | `open()` | Start of the document.
    `protected void` | `openDocument()` | Do the real work of starting the document.
    `void` | `processingInstruction​(java.lang.String name, java.lang.CharSequence value, Location locationId, int properties)` | Output a processing instruction.
    `void` | `startElement​(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties)` | Output an element start tag.
    `void` | `writeDeclaration()` | Output the XML declaration.

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

      `close, closeStartTag, convertToAscii, emptyElementTagCloser, endDocument, getAttributeIndentString, isStarted, namespace, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startDocument, testCharacters, usesTypeAnnotations, writeAttribute, writeCharSequence, writeDocType, writeDocTypeWithNullSystemId, 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`

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

      `getSystemId`

- - ### Constructor Detail

    - #### TEXTEmitter

          public TEXTEmitter()

  - ### Method Detail

    - #### open

          public void open()
                    throws XPathException

      Start of the document.
      Specified by:
        `open` in interface `Receiver`
      Overrides:
        `open` in class `XMLEmitter`
      Throws:
        `XPathException` - if an error occurs

    - #### 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 `XMLEmitter`
      Throws:
        `XPathException` - if an error occurs opening the output file

    - #### writeDeclaration

          public void writeDeclaration()

      Output the XML declaration. This implementation does nothing.
      Overrides:
        `writeDeclaration` in class `XMLEmitter`

    - #### characters

          public void characters​(java.lang.CharSequence chars,
                                 Location locationId,
                                 int properties)
                          throws XPathException

      Produce output using the current Writer.
      Special characters are not escaped.
      Specified by:
        `characters` in interface `Receiver`
      Overrides:
        `characters` in class `XMLEmitter`
      Parameters:
        `chars` - Character sequence to be output
        `locationId` - the location of the node in the source, or of the instruction that created it
        `properties` - bit fields holding special properties of the characters @throws XPathException for any failure
      Throws:
        `XPathException` - if an error occurs

    - #### startElement

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

      Output an element start tag.
      Does nothing with this output method.
      Specified by:
        `startElement` in interface `Receiver`
      Overrides:
        `startElement` in class `XMLEmitter`
      Parameters:
        `elemName` - the name of the element.
        `type` - the type annotation of the element.
        `attributes` - the attributes of this element
        `namespaces` - the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elements
        `location` - an object providing information about the module, line, and column where the node originated
        `properties` - bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in class `ReceiverOption`
      Throws:
        `XPathException` - if an error occurs

    - #### endElement

          public void endElement()

      Output an element end tag.
      Does nothing with this output method.
      Specified by:
        `endElement` in interface `Receiver`
      Overrides:
        `endElement` in class `XMLEmitter`

    - #### processingInstruction

          public void processingInstruction​(java.lang.String name,
                                            java.lang.CharSequence value,
                                            Location locationId,
                                            int properties)
                                     throws XPathException

      Output a processing instruction.
      Does nothing with this output method.
      Specified by:
        `processingInstruction` in interface `Receiver`
      Overrides:
        `processingInstruction` in class `XMLEmitter`
      Parameters:
        `name` - The PI name. This must be a legal name (it will not be checked).
        `value` - The data portion of the processing instruction
        `locationId` - provides information such as line number and system ID.
        `properties` - Additional information about the PI.
      Throws:
        `XPathException` - if an error occurs

    - #### comment

          public void comment​(java.lang.CharSequence chars,
                              Location locationId,
                              int properties)
                       throws XPathException

      Output a comment.
      Does nothing with this output method.
      Specified by:
        `comment` in interface `Receiver`
      Overrides:
        `comment` in class `XMLEmitter`
      Parameters:
        `chars` - The content of the comment
        `locationId` - provides information such as line number and system ID.
        `properties` - Additional information about the comment.
      Throws:
        `XPathException` - if an error occurs