qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] Problem with Aggregate Functions


From: Per Bothner
Subject: Re: [Qexo-general] Problem with Aggregate Functions
Date: Thu, 27 Nov 2003 09:35:47 -0800
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5) Gecko/20031007

Sascha Opletal wrote:

I want to sum up the text fields AND/OR the values of the "c"-Attributes.

Try using the number function:

sum(for $a in doc("/tmp/data.xml")/a/b
return number($a))

From my reading of the XQuery type convering rules, you shouldn't need to use the number function. So this is a bug in Qexo, but not one that has a quick fix. (It probably won't get fixed in 1.8.) Luckily, there is a trivial work-around, and the work-around is both portable and arguably makes the intent of the code clearer.
--
        --Per Bothner
address@hidden   http://per.bothner.com/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]