Class MessageInstr

    • Constructor Detail

      • MessageInstr

        public MessageInstr​(Expression select,
                            Expression terminate,
                            Expression errorCode)
        Create an xsl:message instruction
        select - the expression that constructs the message (composite of the select attribute and the contained sequence constructor)
        terminate - expression that calculates terminate = yes or no.
        errorCode - expression used to compute the error code
    • Method Detail

      • setSelect

        public void setSelect​(Expression select)
      • setTerminate

        public void setTerminate​(Expression terminate)
      • setErrorCode

        public void setErrorCode​(Expression errorCode)
      • 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.

        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
        an iterator containing the sub-expressions of this expression
      • setIsAssert

        public void setIsAssert​(boolean isAssert)
        Say whether this instruction is implementing xsl:message or xsl:assert
        isAssert - true if this is xsl:assert; false if it is xsl:message
      • copy

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

        public int getInstructionNameCode()
        Get the name of this instruction for diagnostic and tracing purposes
        getInstructionNameCode in class Instruction
        a code identifying the instruction: typically but not always the fingerprint of a name in the XSLT namespace
      • getItemType

        public ItemType getItemType()
        Get the item type. To avoid spurious compile-time type errors, we falsely declare that the instruction can return anything
        getItemType in class Instruction
      • getCardinality

        public int getCardinality()
        Get the static cardinality. To avoid spurious compile-time type errors, we falsely declare that the instruction returns zero or one items - this is always acceptable
        getCardinality in class Expression
        zero or one
      • mayCreateNewNodes

        public final boolean mayCreateNewNodes()
        Determine whether this instruction creates new nodes. This implementation returns true.
        mayCreateNewNodes in class Instruction
        true if the instruction creates new nodes under some input conditions (or if it can't be proved that it doesn't)
      • optimize

        public Expression optimize​(ExpressionVisitor visitor,
                                   ContextItemStaticInfo contextInfo)
                            throws XPathException
        Perform optimisation of an expression and its subexpressions. This is the third and final phase of static optimization.

        This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.

        optimize in class Expression
        visitor - an expression visitor
        contextInfo - the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to Type.ITEM_TYPE
        the original expression, rewritten if appropriate to optimize execution
        XPathException - if an error is discovered during this phase (typically a type error)
      • 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
        out - the expression presenter used to display the structure
        XPathException - if the export fails, for example if an expression is found that won't work in the target environment.