Class XSLGeneralVariable

All Implemented Interfaces:
Source, SourceLocator, ActiveSource, GroundedValue, Item, MutableNodeInfo, NamespaceResolver, NodeInfo, Sequence, Location, SteppingNode, SiblingCountingNode, Locator
Direct Known Subclasses:
SaxonAssign, XSLLocalParam, XSLLocalVariable, XSLWithParam

public abstract class XSLGeneralVariable extends StyleElement
This class defines common behaviour across xsl:variable, xsl:param, and xsl:with-param
  • Field Details Link icon

  • Constructor Details Link icon

    • XSLGeneralVariable Link icon

      public XSLGeneralVariable()
  • Method Details Link icon

    • getSourceBinding Link icon

      public SourceBinding getSourceBinding()
      Get the source binding object that holds information about the declared variable.
      Returns:
      the binding object
    • getVariableQName Link icon

      public StructuredQName getVariableQName()
    • getObjectName Link icon

      public StructuredQName getObjectName()
      Description copied from class: StyleElement
      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 null.
      Overrides:
      getObjectName in class StyleElement
      Returns:
      the name of the object declared in this element, if any
    • mayContainSequenceConstructor Link icon

      protected boolean mayContainSequenceConstructor()
      Determine whether this type of element is allowed to contain a template-body
      Overrides:
      mayContainSequenceConstructor in class StyleElement
      Returns:
      true: yes, it may contain a template-body
    • isGlobal Link icon

      public boolean isGlobal()
      Test whether this is a global variable or parameter
      Returns:
      true if this is global
    • validate Link icon

      public void validate(ComponentDeclaration decl) throws XPathException
      Check that the variable is not already declared, and allocate a slot number
      Overrides:
      validate in class StyleElement
      Parameters:
      decl - the declaration being validated. A single XSLVariableDeclaration object may represent multiple declarations if it appears in a stylesheet module that is included/imported more than once
      Throws:
      XPathException - if any error is found during validation
    • postValidate Link icon

      public void postValidate() throws XPathException
      Hook to allow additional validation of a parent element immediately after its children have been validated.
      Overrides:
      postValidate in class StyleElement
      Throws:
      XPathException - if any error is found during post-traversal validation