Class TEXTEmitter

All Implemented Interfaces:
Result, Receiver, ReceiverWithOutputProperties

public class TEXTEmitter extends XMLEmitter
This class generates TEXT output
  • Constructor Details

    • TEXTEmitter

      public TEXTEmitter()
  • Method Details

    • 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(UnicodeString 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(String name, UnicodeString 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(UnicodeString 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