Author Mode "XQueryOperation" and eXist

Issues related to W3C XQuery.
fhorn
Posts: 16

Author Mode "XQueryOperation" and eXist

Thu Jun 18, 2015 8:32 pm

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&amp;v=3&amp;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: 2326

Re: Author Mode "XQueryOperation" and eXist

Thu Jun 18, 2015 10:04 pm

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: 5094

Re: Author Mode "XQueryOperation" and eXist

Fri Jun 19, 2015 9:08 am

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: 16

Re: Author Mode "XQueryOperation" and eXist

Fri Jun 19, 2015 3:56 pm

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

Return to “XQuery”

Who is online

Users browsing this forum: No registered users and 0 guests