Class XSLVariable

All Implemented Interfaces:
Source, SourceLocator, LocationProvider, SaxonLocator, Container, VariableDeclaration, FingerprintedNode, Item, NodeInfo, ValueRepresentation, StylesheetProcedure, InstructionInfo, Locator

public class XSLVariable extends XSLVariableDeclaration
Handler for xsl:variable elements in stylesheet.
The xsl:variable element has mandatory attribute name and optional attribute select
  • Constructor Details

    • XSLVariable

      public XSLVariable()
  • Method Details

    • prepareAttributes

      public void prepareAttributes() throws XPathException
      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
      Overrides:
      prepareAttributes in class XSLGeneralVariable
      Throws:
      XPathException
    • isInstruction

      public boolean isInstruction()
      Determine whether this node is an instruction.
      Overrides:
      isInstruction in class XSLVariableDeclaration
      Returns:
      true - it is an instruction (well, it can be, anyway)
    • 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.
      Specified by:
      getRequiredType in class XSLVariableDeclaration
    • compile

      public Expression compile(Executable exec) throws XPathException
      Compile: used only for global variables. This method ensures space is available for local variables declared within this global variable
      Specified by:
      compile in class StyleElement
      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
    • compileLocalVariable

      public Expression compileLocalVariable(Executable exec) throws XPathException
      Throws:
      XPathException