net.sf.saxon.expr

Class PositionVariable

public class PositionVariable extends Object implements Binding, Serializable

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
PositionVariable()
Create a RangeVariable
Method Summary
ValueRepresentationevaluateVariable(XPathContext context)
Get the value of the range variable
intgetLocalSlotNumber()
If this is a local variable held on the local stack frame, return the corresponding slot number.
SequenceTypegetRequiredType()
Get the required type (declared type) of the variable
StructuredQNamegetVariableQName()
Get the name of the variable, as a namepool name code
booleanisAssignable()
Test 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 variable
voidsetVariableQName(StructuredQName variableName)
Set the name of the variable

Constructor Detail

PositionVariable

public PositionVariable()
Create a RangeVariable

Method Detail

evaluateVariable

public ValueRepresentation evaluateVariable(XPathContext context)
Get the value of the range variable

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.

getRequiredType

public SequenceType getRequiredType()
Get the required type (declared type) of the variable

Returns: the required type

getVariableQName

public StructuredQName getVariableQName()
Get the name of the variable, as a namepool name code

Returns: the nameCode

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.

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.

Returns: true if the binding is global

setSlotNumber

public void setSlotNumber(int nr)
Set the slot number for the range variable

Parameters: nr the slot number to be used

setVariableQName

public void setVariableQName(StructuredQName variableName)
Set the name of the variable

Parameters: variableName the name of the variable