Package com.saxonica.serialize

## Class XQueryEmitter

- java.lang.Object
- - net.sf.saxon.event.SequenceReceiver
  - - net.sf.saxon.serialize.Emitter
    - - net.sf.saxon.serialize.XMLEmitter
      - - com.saxonica.serialize.XQueryEmitter

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

      public class XQueryEmitter
      extends XMLEmitter

  The XQueryEmitter is designed to serialize an XQuery that was originally embedded in an XML document. It is a variant of the XMLEmitter, and differs in that the operators <, >, <=, >=, <<, and >> are output without escaping. They are recognized by virtue of the fact that they appear in text or attribute content between curly braces but not in quotes.

- - ### 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
    --- | ---
    `XQueryEmitter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `writeEscape​(java.lang.CharSequence chars, boolean inAttribute)` | Write contents of array to current writer, after escaping special characters.

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

      `characters, close, closeStartTag, comment, convertToAscii, emptyElementTagCloser, endDocument, endElement, getAttributeIndentString, isStarted, namespace, open, openDocument, processingInstruction, setCharacterReferenceGenerator, setEscapeNonAscii, setIndentForNextAttribute, startDocument, startElement, testCharacters, usesTypeAnnotations, writeAttribute, writeCharSequence, writeDeclaration, writeDocType, 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

    - #### XQueryEmitter

          public XQueryEmitter()

  - ### Method Detail

    - #### writeEscape

          protected void writeEscape​(java.lang.CharSequence chars,
                                     boolean inAttribute)
                              throws java.io.IOException,
                                     XPathException

      Write contents of array to current writer, after escaping special characters. This method converts the XML special characters (such as < and &) into their predefined entities.
      Overrides:
        `writeEscape` in class `XMLEmitter`
      Parameters:
        `chars` - The character sequence containing the string
        `inAttribute` - Set to true if the text is in an attribute value
      Throws:
        `java.io.IOException`
        `XPathException`