xsl-list
[Top] [All Lists]

RE: typing of integer operations in Xpath2

2004-04-20 13:45:06
-----Original Message-----
From: David Carlisle [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk]


Hi,

In my stylesheet all input values
are integers and the only operations I use are:
 + - idiv min max and sum.


Ouch!
Currently the XQuery1.0/XPath2.0 function specs of the latter three all
share one line:

15.3.3 fn:max
...
Any values of type xdt:untypedAtomic in the sequence $arg are cast to
xs:double.

15.3.4 fn:min
...
Any values of type xdt:untypedAtomic in $arg are cast to xs:double.

15.3.5 fn:sum
...
Any values of type xdt:untypedAtomic in $arg are cast to xs:double.

Maybe there's your bugger (?) However, this only seems to go for the input
sequence. If the implementation opts to use the cast type for the output as
well... It doesn't seem to be an explicit no-go, but the examples do seem to
indicate that one may reasonably expect these to be the 'original' type
(--untypedAtomic?), unless asked for by explicitly adding an xs:double to
the sequence.

All with you on this one!


Cheers,

Andreas