com.saxonica.stream.adjunct

## Class ResultDocumentAdjunct

- java.lang.Object
- - com.saxonica.stream.adjunct.StreamingAdjunct
  - - com.saxonica.stream.adjunct.ResultDocumentAdjunct

-     public class ResultDocumentAdjunct
      extends StreamingAdjunct

  Handle an xsl:result-document expression/instruction for XSLT streaming capability.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResultDocumentAdjunct()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FeedMaker` | `getFeedMaker(Expression expression, int arg)` Get a FeedMaker, a factory class that creates a Feed to evaluate this expression in streaming mode.
    `static void` | `processLeft(ResultDocument instr, Stack<XPathContext> contextStack, Stack<Object> state)` In streaming mode, process the first half of the instruction (for example, to start a new document or element)
    `static void` | `processRight(ResultDocument instr, Stack<XPathContext> contextStack, Stack<Object> state)` In streaming mode, process the right half of the instruction (for example, to end a new document or element)

    - ### Methods inherited from class com.saxonica.stream.adjunct.StreamingAdjunct

      `getConfiguration, getWatchMaker, makeStreamingAdjunct, setConfiguration`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResultDocumentAdjunct

          public ResultDocumentAdjunct()

  - ### Method Detail

    - #### getFeedMaker

          public FeedMaker getFeedMaker(Expression expression,
                               int arg)

      Description copied from class: `StreamingAdjunct`
      Get a FeedMaker, a factory class that creates a Feed to evaluate this expression in streaming mode.
      Overrides:
        `getFeedMaker` in class `StreamingAdjunct`
      Parameters:
        `expression` - the expression to be evaluated in streaming mode
        `arg` - identifies the argument with respect to which the expression is to be inverted: usually 0 to indicate the first argument is the value that is streamed. Argument numbering is the same as the sequence of arguments/operands returned by the method `Expression.iterateSubExpressions()`
      Returns:
        a FeedMaker to evaluate the expression, or null if it is not streamable with respect to the specificed argument.

    - #### processLeft

          public static void processLeft(ResultDocument instr,
                         Stack<XPathContext> contextStack,
                         Stack<Object> state)
                                  throws XPathException

      In streaming mode, process the first half of the instruction (for example, to start a new document or element)
      Parameters:
        `instr` - the ResultDocument instruction
        `contextStack` - Stack of XPathContext objects. The instruction should use the one at the top of the stack. Some instructions (such as xsl:result-document) create a new context object and add it to the stack, removing it in the corresponding processRight() action.
        `state` - a stack on which the instruction can save state information during the call on processLeft()
      Throws:
        `XPathException` - if a dynamic error occurs

    - #### processRight

          public static void processRight(ResultDocument instr,
                          Stack<XPathContext> contextStack,
                          Stack<Object> state)
                                   throws XPathException

      In streaming mode, process the right half of the instruction (for example, to end a new document or element)
      Parameters:
        `instr` - the ResultDocument instruction
        `contextStack` - the stack of dynamic context objects
        `state` - a stack on which the instruction can save state information during the call on processLeft()
      Throws:
        `XPathException` - if a dynamic error occurs

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.