- From: Kay, Michael <Michael.Kay@softwareag.com>
- Date: Tue, 8 Oct 2002 13:33:39 +0200
- To: John Mercado <johnkmercado@yahoo.com>, XQuery Comments <public-qt-comments@w3.org>
John Mercado: > > >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? > I'm sure it wasn't anyone's intent to stop sum() working with untyped data, and you are right, the spec is very unclear on this point. Michael Kay
Received on Tuesday, 8 October 2002 07:33:49 UTC