Project

Profile

Help

Bug #3689

closed

Problem with apply-templates in "#current" mode

Added by Debbie Lockett about 6 years ago. Updated almost 6 years ago.

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

100%

Estimated time:
Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
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

Actions #1

Updated by Michael Kay about 6 years 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.

Actions #2

Updated by Debbie Lockett about 6 years 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.

Actions #3

Updated by Debbie Lockett almost 6 years 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