-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Christian GrĂ¼n wrote:
curl -H"Accept:application/json" "http://localhost:8984/all-documents.json"
This now returns the XML version of func() - however now JSON serialized response although %output:method("json") is specified!?
Since Version 8.0, BaseX follows the XQuery 3.1 serialization rules, which serializes arbitrary XML nodes as JSON string [1]. There's one exception, though: BaseX XML representations of JSON documents will continue to be converted from nodes to JSON maps or arrays [2].
What was your server-side output, and what result did you expect?
The result is XML-ish, try yourself:
curl -H"Accept:application/json" http://dev1.veit-schiele.de:8984/all-documents.json
My expectation is receiving a JSON string.
[1] http://www.w3.org/TR/xslt-xquery-serialization-31/#json-output [2] http://docs.basex.org/wiki/XQuery_3.1#JSON_Serialization
I tried to add the "declare option...." to my original code
https://gist.github.com/zopyx/a0219e145d86dc154e5e
but no BaseX love.
Andreas