Project

Profile

Help

Bug #3689

Problem with apply-templates in "#current" mode

Added by Debbie Lockett 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Sprint/Milestone:
-
Start date:
2018-02-19
Due date:
% Done:

100%

Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

For apply templates in current mode, the current component for the new context is not being set. This can result in internal errors.

Problem raised in forum issue: https://saxonica.plan.io/boards/5/topics/7147 - Error XError, message: "Internal error: Target component not found at htmlparse.xsl#423", code: "SXJS0004" when trying to use David Carlisle's XSLT 2.0 implementation of an HTML parser from Saxon-JS

History

#1 Updated by Michael Kay 7 months ago

Note, I think the only case where you can do xsl:apply-templates mode="current" and the current component is not already the same as the current mode is where you are in a named template (current mode survives a call to a named template). If you're in a template rule then the current component is the same as the current mode; in all other cases, the current mode is absent.

#2 Updated by Debbie Lockett 7 months ago

  • Status changed from New to Resolved
  • Fix Committed on JS Branch 1.0, Trunk added

Add code in applyT implementation in Expr.js (line #75):

c2.currentComponent = context.currentMode

Committed on 1.0 and trunk branches.

#3 Updated by Debbie Lockett 5 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 1.1.0

Bug fix applied in the Saxon-JS 1.1.0 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page