Class PositionVariable
java.lang.Object
net.sf.saxon.expr.PositionVariable
- All Implemented Interfaces:
Serializable, 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 ...".
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReference(boolean isLoopingReference) Register a variable reference that refers to the variable bound in this expressionevaluateVariable(XPathContext context) Get the value of the range variableIf the variable is bound to an integer, get the minimum and maximum possible values.intIf 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 codebooleanTest whether it is permitted to assign to the variable using the saxon:assign extension element.booleanisGlobal()Indicate whether the binding is local or global.voidsetSlotNumber(int nr) Set the slot number for the range variablevoidsetVariableQName(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:
getVariableQNamein interfaceBinding- Returns:
- the nameCode
-
addReference
public void addReference(boolean isLoopingReference) Description copied from interface:BindingRegister a variable reference that refers to the variable bound in this expression- Specified by:
addReferencein interfaceBinding- Parameters:
isLoopingReference- - true if the reference occurs within a loop, such as the predicate of a filter expression
-
getRequiredType
Get the required type (declared type) of the variable- Specified by:
getRequiredTypein interfaceBinding- Returns:
- the required type
-
getIntegerBoundsForVariable
If the variable is bound to an integer, get the minimum and maximum possible values. Return null if unknown or not applicable- Specified by:
getIntegerBoundsForVariablein interfaceBinding- Returns:
- a pair of integers containing the minimum and maximum values for the integer value; or null if the value is not an integer or the range is unknown
-
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:
getLocalSlotNumberin interfaceBinding- Returns:
- the slot number on the local stack frame
-
evaluateVariable
Get the value of the range variable- Specified by:
evaluateVariablein interfaceBinding- Parameters:
context- the XPath dynamic evaluation context- Returns:
- the result of evaluating the variable
- Throws:
XPathException- if an error occurs while evaluating the variable
-
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:
isAssignablein interfaceBinding- Returns:
- true if the binding is assignable
-
isGlobal
-