-----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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQGUBAEBAgAGBQJU5JC4AAoJEADcfz7u4AZjnjQLv3yCnP0utg77M0spWoAIwZBg b+byz0762dpf9bP8KwX6Ftcc3R1fsJELk99wrqGCIoP9iXrq6vFkp65jmknsPADS Sp2nSfrI7+Q0JP6ZBhh6YHVcbhzoB2gOHz3P523KMXyrSAGExYxbGbIhvzgg3snO L7FRgQ/wmGgy80+W4LkEK6LWggIOVTOg4kIS77aIeRQwGZKYfGbV0uUzYU3EIxi3 ZyX9jDydkP0aK314kDvRLVjDMtuoVBITUNoUXsij2X9hBnobjMaBP3pS8RgVLJNx BOxPbUwSczvYuUwUQ5oWT7IaZt0J6Xh8g11IuXhnaOHITzMQNatblkIK1vMWygoI 5PVy5Ia0lJe/3fPABp8whtO5pCjorXbkxte6aIew6Xp+Lv1gt0b7vmR6zzByk4TC YPdU5ty8ELmKLwcPKGrX5R5E1PmorOq5SHNMPuGAEGP1BE4KwfJlshrED1u+h/D+ xzAxDmtrTO8UPMiWZ3QneQhz2YmJCAg= =JX48 -----END PGP SIGNATURE-----