Project

Profile

Help

Bug #5162

closed

Failure when using collations in SaxonJS.XPath.evaluate

Added by Michael Kay over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2021-11-12
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:
-

Description

Raised here: https://saxonica.plan.io/boards/5/topics/8361?pn=1&r=8379#message-8379

I was hoping to be able to specify a collation URI as the second parameter to fn:sort when using SaxonJS.XPath.evaluate, but it seems to throw an error: "Cannot read properties of null (reading 'toString')".

Actions #1

Updated by Debbie Lockett about 2 years ago

Note that I added a couple of tests back in December, but didn't manage to reproduce the problem (as commented in the initial forum post). See browser test xpath/evaluate05, and Node.js test xp019 (in xp/mocha_test.js).

Actions #2

Updated by Debbie Lockett about 2 years ago

  • Status changed from New to In Progress

Further test added (nodejs/iss5162 - see the "fn:sort using UCA collation" test currently marked skip) which actually reproduces the issue when using SaxonJS.XPath.evaluate from Node.js.

Actions #3

Updated by Debbie Lockett about 2 years ago

  • Assignee changed from Michael Kay to Debbie Lockett

The error is thrown from within an internal call on resolve-uri (for the collation URI). Apparently in this case, the supplied base is null (i.e. args[1] is an empty sequence), which is not being handled correctly in the resolve-uri code. The base comes from the evalContext.fixed.staticBaseURI (in XPathEval evaluate), which is null for the Node.js platform (but not for the browser platform - which explains why test xpath/evaluate05 didn't reproduce the problem).

Actions #4

Updated by Debbie Lockett about 2 years ago

  • Status changed from In Progress to Resolved
  • Applies to JS Branch 2 added
  • Fix Committed on JS Branch 2 added

Fix committed in resolve-uri code in CoreFn.js.

Actions #5

Updated by Debbie Lockett almost 2 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to SaxonJS 2.4

Bug fix applied in the SaxonJS 2.4 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page