This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: SAXON 5.4 bug in boolean cast to number in xsl:sort


> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@friday.u-net.com]
> Sent: 03 August 2000 23:17
> To: Michael.Kay@icl.com
> Subject: SAXON 5.4 bug in boolean cast to number in xsl:sort
> 
> 
> Mike,
> 
> You may have caught this on XSL-List.

No, I missed it. Either I hit the delete key too quick, or (as I suspect)
XSL-List mail gets to me via Jeni quicker than it does by the direct route.

>  SAXON 5.4 seems not to automatically
> cast booleans to numbers when xsl:sort has a data-type of 'number'.

There's a weirdness in the spec here: the value of the select expression
defining the sort key is always converted first to a string, and if
data-type is "number", this string is then converted to a number. The result
in this case is counter-intuitive, but it's clearly what the spec says.

If you specify a sort key of "number(contains(x,y))" the boolean result of
contains is converted to a number, this is converted to a string to form the
sort key, the fact that data-type="number" then causes this string to be
converted back to a number (it will be the same number in cases other than
NaN, infinity, etc).

Mike Kay
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]