Class WithParam

All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, Binding, EvaluableItem, SequenceIterable, TailCallReturner, InstructionInfo, Locator

public class WithParam extends GeneralVariable
An instruction derived from a xsl:with-param element in the stylesheet.
See Also:
  • Constructor Details

    • WithParam

      public WithParam()
  • Method Details

    • setParameterId

      public void setParameterId(int id)
      Allocate a number which is essentially an alias for the parameter name, unique within a stylesheet
      Parameters:
      id - the parameter id
    • getParameterId

      public int getParameterId()
      Get the parameter id, which is essentially an alias for the parameter name, unique within a stylesheet
      Returns:
      the parameter id
    • getInstructionNameCode

      public int getInstructionNameCode()
      Description copied from class: GeneralVariable
      Get the name of this instruction (that is xsl:variable, xsl:param etc) for diagnostics
      Overrides:
      getInstructionNameCode in class GeneralVariable
      Returns:
      the name of this instruction, as a name pool name code
    • processLeavingTail

      public TailCall processLeavingTail(XPathContext context) throws XPathException
      Description copied from class: Instruction
      ProcessLeavingTail: called to do the real work of this instruction. This method must be implemented in each subclass. The results of the instruction are written to the current Receiver, which can be obtained via the Controller.
      Specified by:
      processLeavingTail in interface TailCallReturner
      Specified by:
      processLeavingTail in class Instruction
      Parameters:
      context - The dynamic context of the transformation, giving access to the current node, the current variables, etc.
      Returns:
      null if the instruction has completed execution; or a TailCall indicating a function call or template call that is delegated to the caller, to be made after the stack has been unwound so as to save stack space.
      Throws:
      XPathException
    • simplify

      public static void simplify(WithParam[] params, ExpressionVisitor visitor) throws XPathException
      Throws:
      XPathException
    • typeCheck

      public static void typeCheck(WithParam[] params, ExpressionVisitor visitor, ItemType contextItemType) throws XPathException
      Throws:
      XPathException
    • optimize

      public static void optimize(ExpressionVisitor visitor, WithParam[] params, ItemType contextItemType) throws XPathException
      Throws:
      XPathException
    • promoteParams

      public static void promoteParams(WithParam[] params, PromotionOffer offer) throws XPathException
      Promote the expressions in a set of with-param elements. This is a convenience method for use by subclasses.
      Throws:
      XPathException
    • getXPathExpressions

      public static void getXPathExpressions(WithParam[] params, List list)
      Get the XPath expressions used in an array of WithParam parameters (add them to the supplied list)
    • displayExpressions

      public static void displayExpressions(WithParam[] params, ExpressionPresenter out)
      DIsplay the parameter expressions
    • replaceXPathExpression

      public static boolean replaceXPathExpression(WithParam[] params, Expression original, Expression replacement)
      Replace a subexpression
    • evaluateVariable

      public ValueRepresentation evaluateVariable(XPathContext context) throws XPathException
      Evaluate the variable (method exists only to satisfy the interface)
      Parameters:
      context - the XPath dynamic evaluation context
      Returns:
      the result of evaluating the variable
      Throws:
      XPathException