#292 xsl:number executed outside for-each

v8.2
closed
5
2012-10-08
2005-01-18
Michael Kay
No

Saxon's optimizer fails to recognize that the result of
xsl:number typically depends on the context node; as a
result, a call on xsl:number may be incorrectly moved
out of a for-each loop, causing incorrect output.

Source fix: in net.sf.saxon.instruct.NumberInstruction

(1) In method iteratorSubExpressions (line 210), change
the start of the method to read:

public Iterator iterateSubExpressions() {
    List sub = new ArrayList(9);
    if (select != null) {
        sub.add(select);
    }
    if (value != null) {
        sub.add(value);
    }

(2) Add the method:

public int getIntrinsicDependencies() {
    return (select == null ?

StaticProperty.DEPENDS_ON_CONTEXT_ITEM : 0);
}

Discussion

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

Sign up for the SourceForge newsletter:





No, thanks