Project

Profile

Help

Bug #5281

closed

Incorrect results from $var[last() on Saxon 11.1

Added by Gunther Rademacher about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2022-02-04
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
11, trunk
Fix Committed on Branch:
11, trunk
Fixed in Maintenance Release:
Platforms:

Description

After updating one of my projects to Saxon 11.1, I see incorrect resuls from a recursive XQuery function. I have boiled this down to a small reproduction in the attached repro.xq, which can be run from command line by

java net.sf.saxon.Query repro.xq

The code contains a recursive function that joins a sequence of string fragments to a multiline string, obeying some interspersed tab directives. The problem is that some fragments just don't appear in the result. The result is correct when running the code on 10.6.

In this particular case, the result will also be correct, when doing one replacement:

              (: result will be correct when replacing '$done[last()]' :)
              (: in the following line by '$last'                      :)
              string-join(($done[last()], string($item)), " ")

Unfortunately this finding did not yet help creating a workaround in the original code.


Files

repro.xq (5.23 KB) repro.xq Gunther Rademacher, 2022-02-04 17:42

Please register to edit this issue

Also available in: Atom PDF