Reputation: 87
I'd like to call an XQuery function that I have written from XForms. I know how to execute a request to an XQuery document:
<xf:submission resource="/exist/rest/apps/Main/modules/import.xql"/>
But what if I'd like to call a specific function in the XQuery document? It looks like this can be done with JavaScript with import module namespace
but is there not a way to do this in XForms?
I suppose I can use exist-db's controller.xql
to handle requests. Is this the simplest way to do it?
Upvotes: 2
Views: 190
Reputation: 3517
You can't! XForms is not XQuery and there is nothing in the XForms specification that let's you import an XQuery module.
As others have previously suggested you need to use HTTP to bridge the two, and if you want direct access over HTTP to an XQuery function, then RESTXQ is your best bet.
Upvotes: 1