Class XSLVariable

All Implemented Interfaces:
Binding, NodeInfo, DOMLocator, Source, SourceLocator, Element, NamedNodeMap, Node, Locator

public class XSLVariable extends XSLGeneralVariable implements Binding
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

    • getSlotNumber

      public int getSlotNumber()
      Description copied from interface: Binding
      Determine a slot number for the variable.
      Specified by:
      getSlotNumber in interface Binding
    • 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)
    • validate

      public void validate() throws TransformerConfigurationException
      Check that the variable is not already declared, and allocate a slot number
      Overrides:
      validate in class XSLGeneralVariable
      Throws:
      TransformerConfigurationException
    • getDataType

      public int getDataType()
      Get the data type, if known statically.
      Specified by:
      getDataType in interface Binding
      Returns:
      the data type if known
    • constantValue

      public Value constantValue()
      Get the value, if known statically.
      Specified by:
      constantValue in interface Binding
      Returns:
      the value if known in advance, or null if not.
    • process

      public void process(Context context) throws TransformerException
      Process the variable declaration
      Specified by:
      process in class StyleElement
      Parameters:
      context - The context in the source XML document, giving access to the current node, the current variables, etc.
      Throws:
      TransformerException