geldfeld
asked on
xquery on multiple documents
I am trying to perform an xquery on a folder of xml documents.
How do I do this.
Can I pass a file as a parameter to xquery ( I am using zorba)
or do the following ( which doesnt work):
for $href in /folder1/folder2/
for $x in doc ( $href )/task
return $x/unity
How do I do this.
Can I pass a file as a parameter to xquery ( I am using zorba)
or do the following ( which doesnt work):
for $href in /folder1/folder2/
for $x in doc ( $href )/task
return $x/unity
ASKER
Zorba does allow the collection function but I seem to be getting the URL path wrong.
I want to go through the test directory in my current folder. So I did the following:
for $xml in collection("file://test?select=*.xml ")
for $x in $xml/task
return $x/unity
it throws an "invalid argument"
ASKER
This query on a single document returns all the children and the childrens children of $x/unity
I just want to show the element names of the immediate children. how do I get it to stop returnign everything?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Saxon and a bunch of other processors I worked with allow this form
for $book in collection("file:///c:/boo
Never tried it in Zorba though
Can you try that first?