This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: SAXON 5.4 bug in boolean cast to number in xsl:sort
- To: "'Jeni Tennison'" <jeni at friday dot u-net dot com>, Kay Michael <Michael dot Kay at icl dot com>
- Subject: RE: SAXON 5.4 bug in boolean cast to number in xsl:sort
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Fri, 4 Aug 2000 00:32:19 +0100
- Cc: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Reply-To: xsl-list at mulberrytech dot com
> -----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