[xquery-talk] Running XQuery using doc() and collection()
Wei, Alice J.
ajwei at indiana.edu
Thu Jan 24 14:51:18 PST 2008
Hi, XQueryers:
One of the members on this list have helped me with the following code:
let $addresses := (doc("1.xml") | doc("3.xml") |doc("4.xml") | doc("2.xml"))//bibl/p/address
let $sorted_result:= for $ad in distinct-values($addresses)
order by $ad ascending
return $ad
for $sorted_results at $count in $sorted_result
let $nodes := $addresses[.=$sorted_results]
where distinct-values($nodes)
return
<address>
<statistics>Showing Result: {$count} / {count($sorted_result)}
</statistics>
{$nodes}
</address>
I have set these files up on another server so now all the files have http://chausie.slis.indiana.edu:8080/exist/rest//db/foo/ in front of it all the the files within the doc() . The problem is that this is running at the speed of 10 seconds for 800KB of data parsing.
I have now switched the first statement from
let $addresses := (doc("1.xml") | doc("3.xml") |doc("4.xml") | doc("2.xml"))//bibl/p/address
to
let $addresses := (fn:collection("xmldb:exist://chausie.slis.indiana.edu:8080//db/resuml")//bibl/p/address)
Now I have now got this error which I have not seen before:
Description: Exception thrown by URIResolver.
Is there a little structural use between collection() and doc()? What should I do to get rid of the error?
Thanks to those who can help.
======================================================
Alice Wei
MIS 2008
School of Library and Information Science
Indiana University Bloomington
ajwei at indiana.edu
More information about the talk
mailing list