Project

Profile

Help

Bug #4629

closed

Failure in key() function (originally from David Carlisle's HTML parser)

Added by Michael Kay over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2020-07-03
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Actions #1

Updated by Michael Kay over 4 years ago

Confirmed that the problem occurs using either compiler to compile the stylesheet.

Actions #2

Updated by Michael Kay over 4 years ago

The problem appears to be that the value of regex-group() does not survive the creation of a new dynamic context by the "/" operator.

The code for the slash operator (Expr.forEach) does

                const c2 = context.newContext(false);
                c2.focus = Iter.Tracker(arg(context));

but the regex groups are held in c2.focus.regexGroups, which is not preserved by these instructions.

Actions #3

Updated by Michael Kay over 4 years ago

I think it's wrong that regexGroups should be a property of context.focus, rather than context itself, so I'm seeing what happens if we change this.

Actions #4

Updated by Michael Kay over 4 years ago

This change fixes the problem, but it needs to be regression-tested.

Actions #5

Updated by Michael Kay over 4 years ago

Regression testing revealed the need to reset regex-groups when evaluating user functions and patterns. The change now seems OK.

It would be useful to add a test to XSLT3 to catch this condition.

Actions #6

Updated by Michael Kay over 4 years ago

  • Status changed from New to Resolved
  • Applies to JS Branch 2.0 added
  • Fix Committed on JS Branch 2.0 added

Added test case analyze-string-100

Actions #7

Updated by Community Admin almost 4 years ago

  • Applies to JS Branch 2 added
  • Applies to JS Branch deleted (2.0)
Actions #8

Updated by Community Admin almost 4 years ago

  • Fix Committed on JS Branch 2 added
  • Fix Committed on JS Branch deleted (2.0)
Actions #9

Updated by Debbie Lockett over 3 years ago

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

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

Please register to edit this issue

Also available in: Atom PDF Tracking page