Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing XQuery xml element as external variable to Marklogic via XCC
    primarykey
    data
    text
    <p>We have a fairly simple XQuery and Groovy code as follows. Xquery code :</p> <pre><code>declare variable $criteria as element(criteria) external ; &lt;scopedInterventions&gt;{ $criteria/equals/field }&lt;/scopedInterventions&gt; </code></pre> <p>Here is the test code that is trying to invoke it</p> <pre><code>def uri = new URI("xcc://admin:admin@localhost:8001") def contentSource = ContentSourceFactory.newContentSource(uri) def request = session.newModuleInvoke("ourQuery.xqy") def criteria = """&lt;criteria&gt; &lt;equals&gt; &lt;field&gt;status&lt;/field&gt; &lt;value&gt;draft&lt;/value&gt; &lt;/equals&gt; &lt;/criteria&gt; """ request.setNewVariable("criteria",ValueType.ELEMENT, criteria); session.submitRequest(request).asString() } </code></pre> <p>We are getting this error when executing:</p> <blockquote> <p>Caused by: com.marklogic.xcc.exceptions.XQueryException: XDMP-LEXVAL: xs:QName("element()") -- Invalid lexical value "element()" [Session: user=admin, cb={default} [ContentSource: user=admin, cb={none} [provider: address=localhost/127.0.0.1:9001, pool=1/64]]] [Client: XCC/5.0-3, Server: XDBC/5.0-3] expr: xs:QName("element()") at com.marklogic.xcc.impl.handlers.ServerExceptionHandler.handleResponse(ServerExceptionHandler.java:34) at com.marklogic.xcc.impl.handlers.EvalRequestController.serverDialog(EvalRequestController.java:83) at com.marklogic.xcc.impl.handlers.AbstractRequestController.runRequest(AbstractRequestController.java:84) at com.marklogic.xcc.impl.SessionImpl.submitRequestInternal(SessionImpl.java:373) at com.marklogic.xcc.impl.SessionImpl.submitRequest(SessionImpl.java:356) at com.zynx.galen.dataaccess.MarkLogicUtilities.executeQueryWithMultipleXMLParameters(MarkLogicUtilities.groovy:52) at com.zynx.galen.repositories.ScopedInterventionService.getScopedInterventionsByCriteria(ScopedInterventionService.groovy:20) ... 1 more</p> </blockquote> <p>Any help would be greately appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload