exist icon indicating copy to clipboard operation
exist copied to clipboard

[BUG] Cannot use Exist API to receive map result from XQuery

Open raducoravu opened this issue 2 years ago • 2 comments

Describe the bug Based on this report: https://www.oxygenxml.com/forum/viewtopic.php?f=1&t=25733 I'm using from Oxygen XML Editor the API "org.exist.xmldb.RemoteXPathQueryService.execute(CompiledExpression)" to run this xpath expression:

 map { 'prop1' : 'value 1', 'prop2' : 'value 2' }

which returns directly a map.

The API returns a RemoteResourceSet, I create an iterator over it, I receive a RemoteXMLResource on which I call org.exist.xmldb.RemoteXMLResource.getContent(). The returned content is an empty string.

Expected behavior The returned content should be some serialization of a map.

To Reproduce

Use the Exist xmldb API to run an xquery like this:

map { 'prop1' : 'value 1', 'prop2' : 'value 2' }
  • Build: [eXist-6.1.0]

raducoravu avatar May 12 '23 09:05 raducoravu

It looks like XDM Function Types are not yet handled correctly. This would require a little bit of work in RpcConnection (for RemoteXMLResource) and LocalXMLResource to add serialization of function types.

adamretter avatar May 12 '23 12:05 adamretter

@adamretter thanks for confirming this.

raducoravu avatar May 12 '23 12:05 raducoravu