#8 Overriding an imported variable

v6.4
closed
7
2012-10-08
2001-07-11
Michael Kay
No

When the stylesheet contains two definitions of the
same global variable with different import precedence
(that is, when a stylesheet module overrides a global
variable defined in a module that it imports), the
following error occurs:
java.lang.IllegalArgumentException: Can't define local
variable: stack is empty

Present since 6.4
Cleared in 6.4.3

Caused by incorrect coding (and testing!) of the
change introduced in 6.4 whereby global variables that
are overridden are no longer evaluated. The process()
method in XSLVariable.java should be changed to read:

public void process(Context context) throws

TransformerException
{
Bindery b = context.getBindery();
if (global) {
if (!redundant && !b.isEvaluated(this)) {
Value value = getSelectValue(context);
b.defineGlobalVariable(this, value);
}
} else {
Value value = getSelectValue(context);
b.defineLocalVariable(this, value);
}
}

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks