Class LiteralResultElement

    • Constructor Detail

      • LiteralResultElement

        public LiteralResultElement()
    • Method Detail

      • mayContainSequenceConstructor

        public boolean mayContainSequenceConstructor()
        Determine whether this type of element is allowed to contain a sequence constructor
        Overrides:
        mayContainSequenceConstructor in class StyleElement
        Returns:
        true: yes, it may contain a sequence constructor
      • isInstruction

        public boolean isInstruction()
        Specify that this is an instruction
        Overrides:
        isInstruction in class StyleElement
        Returns:
        true if this element is an instruction
      • compile

        public Expression compile​(Compilation exec,
                                  ComponentDeclaration decl)
                           throws XPathException
        Compile code to process the literal result element at runtime
        Overrides:
        compile in class StyleElement
        Parameters:
        exec - the compilation episode
        decl - the containing top-level declaration, for example xsl:function or xsl:template
        Returns:
        either a ComputedExpression, or null. The value null is returned when compiling an instruction that returns a no-op, or when compiling a top-level object such as an xsl:template that compiles into something other than an instruction.
        Throws:
        XPathException - if validation fails
      • makeStylesheet

        public DocumentImpl makeStylesheet​(boolean topLevel)
                                    throws XPathException
        Make a top-level literal result element into a stylesheet. This implements the "Simplified Stylesheet" facility.
        Parameters:
        topLevel - true if this is the top level module of a stylesheet; false if it is included or imported
        Returns:
        the reconstructed stylesheet with an xsl:stylesheet and xsl:template element added
        Throws:
        XPathException - if anything goes wrong
      • getObjectName

        public StructuredQName getObjectName()
        Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically. If there is no name, the value will be -1.
        Overrides:
        getObjectName in class StyleElement
        Returns:
        the name of the literal result element