[xquery-talk] Casting to xs:integer

Martin Probst martin at x-hive.com
Mon Feb 27 18:46:21 PST 2006


Hi,

I know I should know this, but I really have a difficult time wrapping
my head around the typing and casting system in XQuery.

When casting a value to an xs:integer, the spec says that in the case of
decimal, float and double source values, non-fractional parts are
dropped.

However the section "Casting from xs:string" says "The resulting
whitespace-normalized string must be a valid lexical form for the
datatype.". So:

5.3 castable as xs:integer => true
"5.3" castable as xs:integer => false
"5" castable as xs:integer => true

Am I right with that?

Martin



More information about the talk mailing list