public interface GlobalVariableManagerThis interface provides access to a collection of global variables. This abstraction is used by the optimizer to handle the rather different ways that global variables are managed in XSLT and XQuery, as a result of XSLT packaging.
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
addGlobalVariable(GlobalVariable variable)Add a global variable to the collection
getEquivalentVariable(Expression select)Get an existing global variable whose initializer is a given expression, if there is one.
GlobalVariable getEquivalentVariable(Expression select)Get an existing global variable whose initializer is a given expression, if there is one. Note that this depends on the logic for detecting equivalence of expressions, which is necessarily approximate. Expressions with dependencies on the static context should never be considered equivalent. If no equivalent global variable is found, return null. An implementation can always return null if it wants to avoid a lengthy search.
- an existing global variable with the same select expression, if one can be found; otherwise null.
void addGlobalVariable(GlobalVariable variable) throws XPathExceptionAdd a global variable to the collection
variable- the variable to be added
XPathException- if errors occur (some implementations of the method have side-effects, such as causing the variable declaration to be compiled)