Class Fork

    • Constructor Detail

      • Fork

        public Fork​(Operand[] prongs)
        Create a Fork instruction
        Parameters:
        prongs - the children of the xsl:fork instructions.
    • Method Detail

      • operands

        public java.lang.Iterable<Operand> operands()
        Description copied from class: Expression
        Get the immediate sub-expressions of this expression, with information about the relationship of each expression to its parent expression. Default implementation works off the results of iterateSubExpressions()

        If the expression is a Callable, then it is required that the order of the operands returned by this function is the same as the order of arguments supplied to the corresponding call() method.

        Specified by:
        operands in class Instruction
        Returns:
        an iterator containing the sub-expressions of this expression
      • getInstructionNameCode

        public int getInstructionNameCode()
        Get the namecode of the instruction for use in diagnostics
        Overrides:
        getInstructionNameCode in class Instruction
        Returns:
        a code identifying the instruction: typically but not always the fingerprint of a name in the XSLT namespace
      • getSize

        public int getSize()
        Get the number of prongs in the fork
        Returns:
        the number of xsl:sequence children
      • getProng

        public Expression getProng​(int i)
        Get the n'th child expression of the xsl:fork (zero-based)
        Parameters:
        i - the index of the required subexpression
        Returns:
        the i'th subexpression if it exists
        Throws:
        java.lang.IllegalArgumentException - if i is out of range
      • getItemType

        public ItemType getItemType()
        Determine the item type of the value returned by the function
        Overrides:
        getItemType in class Instruction
        Returns:
        the static item type of the instruction
      • getStreamerName

        public java.lang.String getStreamerName()
        Get the (partial) name of a class that supports streaming of this kind of expression
        Overrides:
        getStreamerName in class Expression
        Returns:
        the partial name of a class that can be instantiated to provide streaming support in Saxon-EE, or null if there is no such class
      • copy

        public Expression copy​(RebindingMap rebindings)
        Copy an expression. This makes a deep copy.
        Specified by:
        copy in class Expression
        Parameters:
        rebindings -
        Returns:
        the copy of the original expression
      • processLeavingTail

        public TailCall processLeavingTail​(Outputter output,
                                           XPathContext context)
                                    throws XPathException
        Process the instruction, without returning any tail calls. This is the non-streamed mode of operation, which processes the child expressions in turn exactly like a sequence constructor.
        Specified by:
        processLeavingTail in interface TailCallReturner
        Specified by:
        processLeavingTail in class Instruction
        Parameters:
        output - the destination for the result
        context - The dynamic context, giving access to the current node,
        Returns:
        null if the instruction has completed execution; or a TailCall indicating a function call or template call that is delegated to the caller, to be made after the stack has been unwound so as to save stack space.
        Throws:
        XPathException - if a dynamic error occurs during the evaluation of the instruction
      • export

        public void export​(ExpressionPresenter out)
                    throws XPathException
        Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
        Specified by:
        export in interface ExportAgent
        Specified by:
        export in class Expression
        Parameters:
        out - the expression presenter used to display the structure
        Throws:
        XPathException - if the export fails, for example if an expression is found that won't work in the target environment.