> I think it was Ken H who once suggested (context of XSLT 1.0)
select="number($str) = number($str)" as NaN is not equal to itself. I can't
say where he got it. (In XPath 1.0 one was forced to be creative.) Or whether
it would work for you in the given context or indeed corresponds to 'castable
as'.
>
Testing whether the result of number($str) is NaN is usually the same as
testing whether $str is castable to xs:double, but there is at least one case
when it's different, namely when $str is the string "NaN".
Michael Kay
Saxonica
|