Support #1378
closedContext reset by xsl:call-template in Saxon 8.3
0%
Description
SourceForge user: dpirkle
I’ve found a case where a call to xsl:call-template
causes the current context to be reset. I use xsl:for-
each to set the context to the top-level element, and
then call a template. In the template, the context gets
reset to the document node. You can see the problem
by running context1.xsl on context.xml. The second
xsl:message should show the name of the top-level
element (TopLevel), but instead shows a blank. Also,
nothing is seen when viewing the HTML.
Strangely enough, if I move the first xsl:message down
a couple of lines, everything works OK - the context is
not reset. You can see this by running context2.xsl on
context.xml. The second xsl:message shows the name
of the top-level element, and when you view the HTML
you see a “Hello”.
Files
Updated by Anonymous over 19 years ago
SourceForge user: mhkay
Logged In: YES
user_id=251681
Thanks for reporting this. Another optimizer bug: the
expression analyzer has failed to recognize that the call on
xsl:call-templates has an implicit dependency on the
context, and has therefore moved the whole xsl:if expression
out of the xsl:for-each, when it should only have moved the
test expression. I'll prepare a fix and write it up in the
bugs section of the site - probably tomorrow.
Michael Kay
Updated by Anonymous over 19 years ago
SourceForge user: mhkay
Logged In: YES
user_id=251681
The bug (actually a conspiracy of two bugs) is now described at
https://sourceforge.net/tracker/index.php?func=detail&aid=1165676&group_id=29872&atid=397617
Michael Kay
Please register to edit this issue