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 27861 - fn:sort error in example
Summary: fn:sort error in example
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Linux
: P2 minor
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-20 03:13 UTC by Liam R E Quin
Modified: 2015-02-10 17:13 UTC (History)
0 users

See Also:


Attachments

Description Liam R E Quin 2015-01-20 03:13:20 UTC
I see,

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

but I expect to get back
        (1, -2, 5, 8, 10, 10, -10)

Is the implication that duplicates are eliminated?
Comment 1 Michael Kay 2015-01-20 08:44:01 UTC
Thanks, now fixed. 

I think the correct result is

(1, -2, 5, 8, 10, -10, 10)

The values (10, -10, 10) have equal sort keys so their order in the output should be the same as their order in the input.