Author Mode "XQueryOperation" and eXist

Issues related to W3C XQuery.
fhorn
Posts: 18
Joined: Mon Dec 09, 2013 7:47 pm

Author Mode "XQueryOperation" and eXist

Post by fhorn »

Hello,

I have problems to use the operation "XQueryOperation" in the Author mode. The content of the parameter script uses an eXist database module, the module for performing HTTP requests as a client (http://exist-db.org:8098/exist/apps/fun ... ientModule). The parameters sourceLocation, targetLocation and caretPosition are not defined. I receive the following message if I use the action in the Author mode.

Code: Select all

"Couldn't execute operation: 'ro.sync.ecss.extensions.commons.operations.XQueryOperation' for action: 'ExampleAction' because of: Cannot create a transformer from the provided script:
xquery version "3.0";
declare namespace httpclient="http://exist-db.org/xquery/httpclient";
declare namespace tei="http://www.tei-c.org/ns/1.0";
let $url := "https://api.zotero.org/groups/<groupID>/items?format=tei&v=3&key=<key>"
let $data := httpclient:get($url, true(), ())
return $data//tei:title
Reason:F XPST0017: Cannot find a matching 3-argument function named {http://exist-db.org/xquery/httpclient}get() at line 5"
The script is a request for tei-conform data in a specific zotero library. Unfortunately, the library is private, that's why I decoded the zotero group ID ("<groupID>") and the key ("<key>") in this message. The XQuery script works correctly if the file is a resource on the eXist server or stored on my computer.

Here is a snippet of the output:

Code: Select all

<title xmlns="http://www.tei-c.org/ns/1.0" level="m">Dictionary of .../title>
<title xmlns="http://www.tei-c.org/ns/1.0" level="m">Namenarten in ...</title>
I configured eXist as main validator for XQuery files as it is described here: http://www.oxygenxml.com/xml_editor/eXist_support.html
The oXygen version is 16.1 and the eXist version 2.1.

Do you have some hints?

Regards,
Franziska
adrian
Posts: 2850
Joined: Tue May 17, 2005 4:01 pm

Re: Author Mode "XQueryOperation" and eXist

Post by adrian »

Hi,

I'm afraid you can't use XQueryOperation with eXist XQuery. The XQuery engine is not configurable for this operation, it simply uses the Oxygen built-in Saxon XQuery engine.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu
Posts: 8991
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author Mode "XQueryOperation" and eXist

Post by Radu »

Hi,

As a workaround, why don't you use the XQuery function doc directly to load the XML from the HTTP server?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
fhorn
Posts: 18
Joined: Mon Dec 09, 2013 7:47 pm

Re: Author Mode "XQueryOperation" and eXist

Post by fhorn »

Hi,

thank you very much for the quick responses!
Everything works correctly if I use the XQuery function doc to load the XML from the HTTP server.

Regards,
Franziska
Post Reply