|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] Using Sum and CountDavid Carlisle davidc at nag.co.ukTue Jan 15 23:25:13 PST 2008
If I understand your requirement you just want
<statistics>{
count(doc("http://chausie.slis.indiana.edu:8080/exist/rest//db/resume/resume.xml")//projection)
}</statistics>
no need for a FLWR clause here.
for $project in
doc("http://chausie.slis.indiana.edu:8080/exist/rest//db/resume/resume.xml"),
using for over a single node is rather odd in xquery (it means the same
as let, it's needed in Xpath2 which lacks the let clause, but not here)
$head in $project//projection
here again I think you intended let rather than for, using for means
that $head gets bound, on each iteration, to a single projection
element, so count($head) is always going to be 1.
Conversely
let $head := $project//projection
would bind $head to the sequence of elements so count() would do
something useful.
finally I'm not sure what you intended to sum with sum() but expressions
need to be in {} as otherwise it's just taken as a text node child of
the generated eleemnt.
David
________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________
|
Purchase Stylus Studio Online Today!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






