Project

Profile

Help

Bug #4629

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

Added by Michael Kay 3 months ago. Updated 3 months ago.

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

0%

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

History

#1 Updated by Michael Kay 3 months ago

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

#2 Updated by Michael Kay 3 months 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.

#3 Updated by Michael Kay 3 months 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.

#4 Updated by Michael Kay 3 months ago

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

#5 Updated by Michael Kay 3 months 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.

#6 Updated by Michael Kay 3 months 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

Please register to edit this issue

Also available in: Atom PDF Tracking page