Class XSLLocalVariable

All Implemented Interfaces:
Source, SourceLocator, ActiveSource, GroundedValue, Item, MutableNodeInfo, NamespaceResolver, NodeInfo, Sequence, Location, SteppingNode, SiblingCountingNode, Locator

public class XSLLocalVariable extends XSLGeneralVariable
Handler for xsl:variable elements acting as local variable declarations in a stylesheet.
The xsl:variable element has mandatory attribute name and optional attribute select
  • Constructor Details

    • XSLLocalVariable

      public XSLLocalVariable()
  • Method Details

    • getBindingInformation

      public SourceBinding getBindingInformation(StructuredQName name)
      Ask whether this element contains a binding for a variable with a given name; and if it does, return the source binding information
      Overrides:
      getBindingInformation in class StyleElement
      Parameters:
      name - the variable name
      Returns:
      the binding information if this element binds a variable of this name; otherwise null
    • isInstruction

      public boolean isInstruction()
      Determine whether this node is an instruction.
      Overrides:
      isInstruction in class StyleElement
      Returns:
      true - it is an instruction (well, it can be, anyway)
    • prepareAttributes

      protected void prepareAttributes()
      Description copied from class: StyleElement
      Set the attribute list for the element. This is called to process the attributes (note the distinction from processAttributes in the superclass). Must be supplied in a subclass
      Specified by:
      prepareAttributes in class StyleElement
    • getRequiredType

      public SequenceType getRequiredType()
      Get the static type of the variable. This is the declared type, unless the value is statically known and constant, in which case it is the actual type of the value.
      Returns:
      the declared or inferred type
    • fixupReferences

      public void fixupReferences() throws XPathException
      Description copied from class: StyleElement
      Fix up references from XPath expressions. Overridden for function declarations and variable declarations
      Overrides:
      fixupReferences in class StyleElement
      Throws:
      XPathException - if any references cannot be fixed up.
    • compileLocalVariable

      public void compileLocalVariable(Compilation exec, ComponentDeclaration decl) throws XPathException
      Process this local variable declaration by expanding any sequence constructor and setting the select expression to the result
      Parameters:
      exec - the executable
      decl - the declaration being compiled
      Throws:
      XPathException - if an error occurs