Discussion:
[xquery-talk] Castable integers
Ihe Onwuka
2014-02-21 16:18:31 UTC
Permalink
3 castable as xs:integer -> true

"3" castable as xs:integer -> true

3.5 castable as xs:integer -> true ..... hmmmmm debatable that one

ok...(scratches head)....so if it's roundable to an integer it's
castable to an integer

fine

"3.5" castable as xs:integer -> false

Btw which list is the home for XPath stuff.
Michael Kay
2014-02-21 17:16:18 UTC
Permalink
Yes, castability is not transitive. Well spotted.

You get some pretty strange results with boolean() too, e.g.

boolean(string(false())) => true().

Michael Kay
Saxonica
Post by Ihe Onwuka
3 castable as xs:integer -> true
"3" castable as xs:integer -> true
3.5 castable as xs:integer -> true ..... hmmmmm debatable that one
ok...(scratches head)....so if it's roundable to an integer it's
castable to an integer
fine
"3.5" castable as xs:integer -> false
Btw which list is the home for XPath stuff.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
--~--
Loading...