Class XSLVariable

  • All Implemented Interfaces:
    Binding, NodeInfo, javax.xml.transform.dom.DOMLocator, javax.xml.transform.Source, javax.xml.transform.SourceLocator, org.w3c.dom.Element, org.w3c.dom.NamedNodeMap, org.w3c.dom.Node, org.xml.sax.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 Detail

      • XSLVariable

        public XSLVariable()
    • Method Detail

      • 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 javax.xml.transform.TransformerConfigurationException
        Check that the variable is not already declared, and allocate a slot number
        Overrides:
        validate in class XSLGeneralVariable
        Throws:
        javax.xml.transform.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 javax.xml.transform.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:
        javax.xml.transform.TransformerException