Package net.sf.saxon.expr
Class PositionVariable
java.lang.Object
net.sf.saxon.expr.PositionVariable
- All Implemented Interfaces:
Binding
Represents the defining occurrence of the position variable in a for expression
within an expression, for example the $p in "for $x at $p in ...".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluateVariable
(XPathContext context) Get the value of the range variableint
If this is a local variable held on the local stack frame, return the corresponding slot number.Get the required type (declared type) of the variableGet the name of the variable, as a namepool name codeboolean
Test whether it is permitted to assign to the variable using the saxon:assign extension element.boolean
isGlobal()
Indicate whether the binding is local or global.void
setSlotNumber
(int nr) Set the slot number for the range variablevoid
setVariableQName
(StructuredQName variableName) Set the name of the variable
-
Constructor Details
-
PositionVariable
public PositionVariable()Create a RangeVariable
-
-
Method Details
-
getVariableQName
Get the name of the variable, as a namepool name code- Specified by:
getVariableQName
in interfaceBinding
- Returns:
- the nameCode
-
getRequiredType
Get the required type (declared type) of the variable- Specified by:
getRequiredType
in interfaceBinding
- Returns:
- the required type
-
setVariableQName
Set the name of the variable- Parameters:
variableName
- the name of the variable
-
setSlotNumber
public void setSlotNumber(int nr) Set the slot number for the range variable- Parameters:
nr
- the slot number to be used
-
getLocalSlotNumber
public int getLocalSlotNumber()If this is a local variable held on the local stack frame, return the corresponding slot number. In other cases, return -1.- Specified by:
getLocalSlotNumber
in interfaceBinding
- Returns:
- the slot number on the local stack frame
-
evaluateVariable
Get the value of the range variable- Specified by:
evaluateVariable
in interfaceBinding
- Parameters:
context
- the XPath dynamic evaluation context- Returns:
- the result of evaluating the variable
- Throws:
XPathException
-
isAssignable
public boolean isAssignable()Test whether it is permitted to assign to the variable using the saxon:assign extension element. This will only be for an XSLT global variable where the extra attribute saxon:assignable="yes" is present.- Specified by:
isAssignable
in interfaceBinding
- Returns:
- true if the binding is assignable
-
isGlobal
public boolean isGlobal()Indicate whether the binding is local or global. A global binding is one that has a fixed value for the life of a query or transformation; any other binding is local.
-