F&O avg and sum should automatically cast anySimpleType to numeric

>From the way I read the descriptions of the avg and
sum functions, you can't use them if the values in the
sequence aren't explicitly typed as numbers.  For
example, if my instance is:

<root>
  <num>12</num>
  <num>15</num>
</root>

I can't say sum(//num) unless I have a schema that
declares that num has a numeric type.  

This seems like a major inconvenience and an
incompatibility with XPath 1.0.  I hope I'm missing
something.

Of course, it may be that when the spec says "If,
after this, $srcval contains only numbers..." it means
"contains only atomic values with numeric types _or_
anySimpleType values that can be cast to numeric
types." Is that the part I'm missing?

Thanks,
John

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Received on Tuesday, 8 October 2002 02:27:13 UTC