This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Bug Sorting Zeros
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] Bug Sorting Zeros
- From: David_N_Bertoni at lotus dot com
- Date: Mon, 25 Jun 2001 10:45:17 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
Yes, that's exactly what's going on. Since 'TOTAL' would convert to NaN,
Xalan, when sorting, chooses to sort all NaN values as if they were 0. The
reason that 'TOTAL' appears after 0 is due to the following sentence from
the XSLT recommendation, section 10:
"The sort must be stable: in the sorted list of nodes, any sub list that
has sort keys that all compare equal must be in document order."
This is one of the great, unanswered questions: since NaN is not ordered,
how do you order it in a sort?
Maybe one of the working group members can comment as to whether or not the
working group is going to address this?
Dave
"Gareth Sylvester-Bradley"
<gareth.sbradley@adv.sonybp To: <xsl-list@lists.mulberrytech.com>
e.com> cc: (bcc: David N Bertoni/CAM/Lotus)
Sent by: Subject: RE: [xsl] Bug Sorting Zeros
owner-xsl-list@lists.mulber
rytech.com
06/25/2001 09:51 AM
Please respond to xsl-list
> BEFORE THE SORT: 0,1,2,3,4....52,TOTAL
> AFTER THE SORT (ascending order): 0,TOTAL,1,2,3,4....52
> AFTER THE SORT (descending order): 52,51,50......3,2,1,0,TOTAL
Doesn't this look more like the string 'TOTAL' is being sorted as if it
were
zero (and a stable sorted used)?
*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
**************************************************************************
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list