Package com.saxonica.ee.stream.feed

## Class SimpleNodeConstructorFeed

- java.lang.Object
- - net.sf.saxon.event.Outputter
  - - net.sf.saxon.event.ProxyOutputter
    - - com.saxonica.ee.stream.feed.ItemFeed
      - - com.saxonica.ee.stream.feed.SimpleNodeConstructorFeed

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

      public class SimpleNodeConstructorFeed
      extends ItemFeed

  This class is used when a streaming template requests evaluation of a simple content constructor in streaming mode (that is, when it constructs a text, attribute, comment, or PI node based on the contents of the streamed document).

  The SimpleContentFeed is used when the node is constructed as a result of a computation on the streamed data, for example `xsl:value-of select="distinct-values(.//@price)"`. By contrast, a SimpleContentWatch is used when the streamed nodes are selected directly, for example `xsl:value-of select=".//@price"`.

  Both a Feed and a Watch are needed because a simple content constructor operates on a sequence of nodes without simply atomizing the sequence.

- - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.event.Outputter

      `pipelineConfiguration, systemId`

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

      `PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SimpleNodeConstructorFeed​(Expression expr, ItemFeed result, XPathContext context)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `append​(Item item)` | Supply an item to the feed
    `void` | `close()` | Finish evaluating the expression.
    `CharSequenceConsumer` | `getStringReceiver​(boolean asTextNode, Location loc)` | Get a string-value consumer object that allows an item of type xs:string to be appended one fragment at a time.

    - ### Methods inherited from class com.saxonica.ee.stream.feed.ItemFeed

      `append, dynamicError, endSelectedParentNode, getContext, getExpression, getResult, getTerminator, hasFailed, open, processItems, setExpression, setHasFailed, setTerminator, startSelectedParentNode`

    - ### Methods inherited from class net.sf.saxon.event.ProxyOutputter

      `attribute, characters, comment, endDocument, endElement, getNextOutputter, namespace, open, processingInstruction, setLocation, setUnparsedEntity, startContent, startDocument, startElement, startElement, usesTypeAnnotations`

    - ### Methods inherited from class net.sf.saxon.event.Outputter

      `getConfiguration, getPipelineConfiguration, getSystemId, namespaces, 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

      `handlesAppend`

- - ### Constructor Detail

    - #### SimpleNodeConstructorFeed

          public SimpleNodeConstructorFeed​(Expression expr,
                                           ItemFeed result,
                                           XPathContext context)

  - ### Method Detail

    - #### append

          public void append​(Item item)
                      throws XPathException

      Supply an item to the feed
      Specified by:
        `append` in interface `Receiver`
      Specified by:
        `append` in class `ItemFeed`
      Parameters:
        `item` - the item being fed
      Throws:
        `XPathException` - to report any failure

    - #### getStringReceiver

          public CharSequenceConsumer getStringReceiver​(boolean asTextNode,
                                                        Location loc)

      Description copied from class: `Outputter`
      Get a string-value consumer object that allows an item of type xs:string to be appended one fragment at a time. This potentially allows operations that output large strings to avoid building the entire string in memory. The default implementation, however, simply assembles the string in a buffer and releases the entire string on completion.
      Overrides:
        `getStringReceiver` in class `Outputter`
      Parameters:
        `asTextNode` - set to true if the concatenated string values are to be treated as a text node
        `loc` - the location of the instruction generating the content
      Returns:
        an object that accepts xs:string values via a sequence of append() calls

    - #### close

          public void close()
                     throws XPathException

      Description copied from class: `ItemFeed`
      Finish evaluating the expression.
      Specified by:
        `close` in interface `Receiver`
      Overrides:
        `close` in class `ItemFeed`
      Throws:
        `XPathException` - if a dynamic error occurs