exist
exist copied to clipboard
[BUG] Cannot use Exist API to receive map result from XQuery
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]
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 thanks for confirming this.