3

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?

proxx
  • 61
  • 3
  • I think you may need to paste in some more code--I'm not seeing anything in your code where you're actually attempting to hit a WebDAV host. – Brian Warshaw Dec 16 '15 at 16:20
  • I am connecting the CMS repository with WebDAV. The connection is set up in Oxygen's Data Source Explorer, where I can import new files. Server connection requires VPN. – proxx Dec 16 '15 at 23:13

1 Answers1

1

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!

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
  • Thank you for the answer. For my purposes it was easier to set up a server connection in local file browser so that the file path is treated as directory and collection works just fine. – proxx Jan 12 '16 at 14:31