Project

Profile

Help

Bug #3243

closed

Variables incorrectly in-lined into xsl:on-completion

Added by John Lumley almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2017-06-01
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7, trunk
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:

Description

For the code

<xsl:variable name="me">
     <xsl:copy-of select="."/>
</xsl:variable>
<xsl:iterate select="*">
     <xsl:on-completion>
         <xsl:sequence select="$me"/>
     </xsl:on-completion>
     <xsl:sequence select="."/>
</xsl:iterate>

Saxon incorrectly in-lines the variable into the @on-completion@, where on execution the context item is absent and hence an error is raised. The export is:

<iterate role="action" ns="xsl=~ xs=~ math=http://www.w3.org/2005/xpath-functions/math" line="21">
     <axis role="select" name="child" nodeTest="element()" jsTest="return item.nodeType===1;"/>
     <params role="params"/>
     <doc role="on-completion" line="19" validation="preserve">
      <copyOf flags="vsc">
       <dot type="element(Q{}out)"/>
      </copyOf>
     </doc>
     <dot role="action" line="25" type="element()"/>
</iterate>

As a workround, a reference through xsl:message can suppress the inlining.

Please register to edit this issue

Also available in: Atom PDF