#18 Overriding an imported param

v6.4.2
closed
Michael Kay
5
2012-10-08
2001-07-27
Michael Kay
No

This is essentially the same as <a
href="http://sourceforge.net/tracker/index.php?
func=detail&aid=440384&group_id=29872&atid=397617">4403
84</a>, but applies to global xsl:param declarations
rather than xsl:variable declarations. The fix for
440384 worked for variables, but the bug applied both
to variables and params.

Also, the observed effect in this case was different.
Instead of referencing off the end of an array, the
wrong element of the array (containing the value of a
different variable) was referenced. In this case this
led to failure because the value was of the wrong
type, but it might equally well have just returned the
wrong value.

The problem occurs whenever a global xsl:param in an
imported stylesheet is overridden by a global
xsl:param or xsl:variable in the importing stylesheet.

Reported by Mark Neves [Mark.Neves@xitec-software.com]

Reported against 6.4.3, present since 6.4 (but
previously masked by other errors).

Source code fixed, will be cleared in next version.
The change is to com.icl.saxon.style.XSLParam, lines
60-70 now read:

    if (!wasSupplied) {                   
        if (global) { 
            if (!redundant) { 
                Value value = getSelectValue

(context);
bindery.defineGlobalVariable(this,
value);
}
} else {
Value value = getSelectValue
(context);
bindery.defineLocalVariable(this,
value);
}
}
MK

Discussion