I am using Oxygen XML Editor 17.0 (Saxon XQuery 9.6.0.5). Recently I have created a very basic XQuery code to perform some statistic measurements over the XML files on Web Dav server. Let's say I just want to count the number of .xml files in one directory. I added the XQuery file to the location where .xml files are. Here is the code:
xquery version "3.0" encoding "utf-8";
let $docs := collection('./?select=*.xml')
return count($docs)
I receive an error message: "FODC0004: Collection catalog should not use a namespace"
The code works fine when run locally. I am also able to search over one particular file (on server) using absolute path, but I want to have a universal code.
I am guessing it is connected with some restrictions on Web Dav server, but I am a newbie in this area. Could you please advice?
If you're using the standard collection URI resolver in Saxon 9.6, then it will first ask "is this URI a file-scheme URI representing a directory", and if the answer is no (which is presumably the case here) then it will try to open the resource as an XML document containing a list of URIs for the things in the collection; which is failing with the error message you see.
Saxon has no intrinsic support for WebDAV, but you should be able to support it easily enough by writing your own CollectionURIResolver. If you get it working, please share the code!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With