#1079 Optimizer loop-lifting bug with document switching

v9.2
closed
Michael Kay
5
2012-10-08
2010-07-07
Michael Kay
No

Within an xsl:for-each loop that does not change the context document (for example xsl:for-each select="child::"), a subexpression that depends on the context document but not on any other part of the focus (for example //a) is eligible for loop-lifting, that is, for evaluation outside the loop to avoid repeated evaluation. This rule is not applied correctly when there is an outer xsl:for-each loop that makes a same-document selection (for example xsl:for-each select="child::") and an inner xsl:for-each that changes the context document (for example xsl:for-each select="doc(xxx)"). An expression such as "//a" is lifted out of the outer loop, failing to take account of the fact that the inner for-each changes the context document.

A patch is being placed in Subversion.

Discussion

  • Michael Kay
    Michael Kay
    2010-08-09

    Fixed in 9.2.1.2