Class XSLVariable

All Implemented Interfaces:
Serializable, Source, SourceLocator, LocationProvider, SaxonLocator, PullEvent, Container, VariableDeclaration, FingerprintedNode, Item<NodeInfo>, MutableNodeInfo, NamespaceResolver, NodeInfo, ValueRepresentation<NodeInfo>, StylesheetProcedure, InstructionInfo, SiblingCountingNode, 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
See Also:
  • 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 - if a static error is detected
    • 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
      Returns:
      the static type declared for the variable
    • compileDeclaration

      public void compileDeclaration(Executable exec, Declaration decl) throws XPathException
      Compile: used only for global variables. This method ensures space is available for local variables declared within this global variable
      Overrides:
      compileDeclaration in class StyleElement
      Parameters:
      exec - the Executable
      decl - the containing top-level declaration, for example xsl:function or xsl:template
      Throws:
      XPathException - if compilation fails
    • compileLocalVariable

      public LocalVariable compileLocalVariable(Executable exec, Declaration decl) throws XPathException
      Throws:
      XPathException