Project

Profile

Help

Bug #5390

closed

document() doesn't remove duplicates

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2022-03-13
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

The SaxonJS implementation of the document() function, if given a list of URIs that includes duplicates, doesn't eliminate duplicate document nodes from the result, nor does it sort the result into document order.

As a result, test document-0401 is failing in SaxonJS with the XJ compiler but succeeds with the XX compiler. The failure is because it doesn't eliminate duplicate nodes. The XX compiler produces a SEF file containing a docOrder instruction (actually two, one of them redundant) while the XJ compiler output has no such instruction.

With the XX compiler the test is succeeding by accident, because the result of document(A)//body has duplicates eliminated even though the result of document(A) doesn't. But we shouldn't be relying on the "/" operator to do the deduplication; it should be done even for a free-standing call on document().

Actions #1

Updated by Michael Kay about 2 years ago

  • Status changed from New to Resolved

Fixed in CoreFn.document by wrapping the iterator currently returned by the function in a call of DU.inDocumentOrder().

Actions #2

Updated by Debbie Lockett almost 2 years ago

  • Applies to JS Branch 2 added
  • Fix Committed on JS Branch 2 added
Actions #3

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