This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29266 - Incorrect example for array:sort
Summary: Incorrect example for array:sort
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2015-11-06 13:11 UTC by Adam Retter
Modified: 2016-03-22 09:57 UTC (History)
0 users

See Also:


Description Adam Retter 2015-11-06 13:11:38 UTC
I think the second example given for array:sort in XPath F+O 3.1 may be incorrect in both the latest public and latest internal drafts.

The example given in the spec is:

The expression array:sort([1, -2, 5, 10, -10, 10, 8], fn:abs#1) returns (1, -2, 5, 8, 10, -10).

However, if I am not mistaken then the return value should actually be:

[1, -2, 5, 8, 10, -10, 10]

That is to say that (1) the example is missing a value in the return array, and (2) that in the example the result is shown as a sequence however it should be an array.

Cheers Adam.
Comment 1 Michael Kay 2015-11-17 16:28:58 UTC
It was agreed that the example should be corrected, and the change has been applied.