document() doesn't remove duplicates
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().
Updated by Michael Kay about 1 year ago
- Status changed from New to Resolved
CoreFn.document by wrapping the iterator currently returned by the function in a call of
Updated by Debbie Lockett 12 months ago
- Applies to JS Branch 2 added
- Fix Committed on JS Branch 2 added
Updated by Debbie Lockett 11 months 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