Class LiteralResultElement

    • Constructor Detail

      • LiteralResultElement

        public LiteralResultElement()
    • Method Detail

      • mayContainSequenceConstructor

        protected 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
      • validateChildren

        protected void validateChildren​(ComponentDeclaration decl,
                                        boolean excludeStylesheet)
                                 throws XPathException
        Validate the children of this node, recursively. Overridden for top-level data elements.
        Overrides:
        validateChildren in class StyleElement
        Parameters:
        decl - the declaration whose children are to be validated
        excludeStylesheet - true if the xsl:stylesheet element is to be excluded
        Throws:
        XPathException - if validation fails
      • 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