XQuery collection() function on Web Dav server
Issues related to W3C XQuery.
-
- Posts: 6
- Joined: Wed Dec 16, 2015 3:49 pm
XQuery collection() function on Web Dav server
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:
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?
Code: Select all
xquery version "3.0" encoding "utf-8";
let $docs := collection('./?select=*.xml')
return count($docs)
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?
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: XQuery collection() function on Web Dav server
Hi,
Basically as Michael Kay explained you:
http://stackoverflow.com/questions/3431 ... dav-server
the Saxon processor can only use the collection function to iterate a folder's contents when running the query over a local set of resources.
In the Oxygen Preferences->XML / XSLT-FO-XQuery / XSLT / Saxon / Saxon-HE/PE/EE / Advanced you can set a custom collection URI resolver Java implementation.
Another possible workaround would be instead of using a plain WebDav server to install the Exist XML Database. Exist allows you to run xqueries on the server side.
Regards,
Radu
Basically as Michael Kay explained you:
http://stackoverflow.com/questions/3431 ... dav-server
the Saxon processor can only use the collection function to iterate a folder's contents when running the query over a local set of resources.
In the Oxygen Preferences->XML / XSLT-FO-XQuery / XSLT / Saxon / Saxon-HE/PE/EE / Advanced you can set a custom collection URI resolver Java implementation.
Another possible workaround would be instead of using a plain WebDav server to install the Exist XML Database. Exist allows you to run xqueries on the server side.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 26
- Joined: Wed Jun 17, 2015 10:01 pm
Re: XQuery collection() function on Web Dav server
What would such a declaration look like for a collection of files in the following folder? I'm getting the same error but the documentation doesn't really give any examples for those preferences.
This is the line of code throwing the error:
let $names := collection('file:///D:/BlueMountainTEI/periodicals/bmtnaau/issues/1908/03_01/bmtnaau_1908-03_01.tei.xml')//tei:relatedItem[@type='constituent']//tei:persName
Thanks
This is the line of code throwing the error:
let $names := collection('file:///D:/BlueMountainTEI/periodicals/bmtnaau/issues/1908/03_01/bmtnaau_1908-03_01.tei.xml')//tei:relatedItem[@type='constituent']//tei:persName
Thanks
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery collection() function on Web Dav server
Hi,
Any reason why you're using collection and not doc() in this particular case?
Regards,
Adrian
Any reason why you're using collection and not doc() in this particular case?
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XQuery collection() function on Web Dav server
Well, to answer your question, if you want a collection with all the .xml files from a local folder you can use:
Regards,
Adrian
Code: Select all
collection('file:///D:/BlueMountainTEI/periodicals/bmtnaau/issues/1908/03_01/?select=*.xml;recurse=yes')
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service