Project

Profile

Help

Support #1378

closed

Context reset by xsl:call-template in Saxon 8.3

Added by Anonymous over 19 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Internals
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Legacy ID:
sf-1164883
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

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

context.zip (9.56 KB) context.zip Anonymous, 2005-03-16 23:20
Actions #1

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

Actions #2

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

Also available in: Atom PDF