I have the following code, and the saxon jar file I have cannot read xquery 3.0.
for $item in doc("order.xml")//item
group by $d := $item/@dept
order by $d
return
<department totalQuantity="{sum($item/@quantity)}"
code="{$d}"
numItems="{count($item)}"/>
The output displays the department, totalQuantity, and the number of items. It's supposed to be grouped by the code, the code above doesn't compile.
I was hoping theres a way that would work with xquery 1.0