Class GlobalParam

All Implemented Interfaces:
SourceLocator, Binding, ContextOriginator, ExpressionOwner, Locatable, Declaration, Location, Traceable, TraceableComponent, Locator

public final class GlobalParam extends GlobalVariable
The compiled form of a global xsl:param element in an XSLT stylesheet or an external variable declared in the prolog of a Query.
The xsl:param element in XSLT has mandatory attribute name and optional attribute select. It can also be specified as required="yes" or required="no". In standard XQuery 1.0 external variables are always required, and no default value can be specified; but Saxon provides an extension pragma that allows a query to specify a default. XQuery 1.1 adds standard syntax for defining a default value.
  • Constructor Details

    • GlobalParam

      public GlobalParam()
  • Method Details

    • setImplicitlyRequiredParam

      public void setImplicitlyRequiredParam(boolean requiredParam)
      Indicate that this parameter is implicitly required, because the default value does not match the type
      Parameters:
      requiredParam - true if this is a required parameter
    • isImplicitlyRequiredParam

      public boolean isImplicitlyRequiredParam()
      Ask whether this variable represents a required parameter
      Returns:
      true if this variable represents a required parameter
    • getTracingTag

      public String getTracingTag()
      Description copied from class: Actor
      Get a string used to identify this kind of component when used in tracing output
      Specified by:
      getTracingTag in interface TraceableComponent
      Overrides:
      getTracingTag in class GlobalVariable
      Returns:
      a diagnostic string used to identify the component when tracing
    • evaluateVariable

      public GroundedValue evaluateVariable(XPathContext context, Component target) throws XPathException
      Evaluate the variable
      Overrides:
      evaluateVariable in class GlobalVariable
      Parameters:
      context - the XPath dynamic context
      target - the component representing this variable (in the context of a package where it is used)
      Returns:
      the value of the variable
      Throws:
      XPathException - if evaluation of the variable fails with a dynamic error
    • evaluateVariable

      public GroundedValue evaluateVariable(XPathContext context) throws XPathException
      Evaluate the variable
      Specified by:
      evaluateVariable in interface Binding
      Overrides:
      evaluateVariable in class GlobalVariable
      Parameters:
      context - the XPath dynamic evaluation context
      Returns:
      the result of evaluating the variable
      Throws:
      XPathException - if an error occurs while evaluating the variable
    • getFlags

      protected String getFlags()
      Overrides:
      getFlags in class GlobalVariable