I noticed in your example that you first created an XML document that contained URLs for all of the files that you wanted to iterate through. I was wondering if there's a way to iterate through a series of files? Something like this:
You could try it, but if it works with one XQuery implementation it won't necessarily work with another. From http://www.w3.org/TR/xpath-functions/#func-collection:
"This function provides a facility for users to work with a collection of documents which may be contained in a directory or rows of a Relational table or other implementation-specific construct. An implementation may also use external variables to identify external resources, but fn:collection() provides functionality not provided by external variables."
So the implementation has some leeway.
Because I love the name func-collection so much, I will also add the URL http://www.amazon.com/exec/obidos/tg/detail/-/B000007RQ9/103-8915257-7975822
But even if that does work, is there any guarantee that the query would be starting afresh for each new file? Becoz i need to do that. I need the query to execute through each xml file in a directory (even under subdirectories of this directory). but it should consider each file as a new beginning. any help on this would be most welcome. please? Thanks a million anyways. :)