> Really, why have you removed that ? Because there is the new options
> argument...it's more complex but ok if knew how to use it with REST
> API, please help me ^^ :
> http://localhost:8984/rest/factbook?query=//city/name&wrap=yes&method=json&options=??

So I finally found how to do that  via REST :
http://localhost:8984/rest/factbook?query=//city/name&wrap=yes&method=json&json=format=jsonml

I'm not very happy with the syntax, which is more heavy than the old
method=jsonml, and less clear (json=format=jsonml). But you can add
other options like indent=no :
http://localhost:8984/rest/factbook?query=//city/name&wrap=yes&method=json&json=format=jsonml,indent=no

Maybe a shortcut method=jsonml could be back for simplicity ?

And add an example to the wiki ^^

Florent

> Cheers
>
> Florent
>
>> Cheers
>>
>> Florent
>>
>>
>>> On 07/04/14 17:41, Florent Gallaire wrote:
>>>> Hello,
>>>>
>>>> I'm new in the XML databases world, evaluating BaseX and eXist-db for
>>>> a new project.
>>>>
>>>> BaseX seems really clean and lightweight.
>>>>
>>>> I would like to use it via the REST API and with a json output.
>>>>
>>>> I test with the factbook.xml example database and the method parameter
>>>> set to "json" :
>>>> http://localhost:8984/rest/factbook?query=//city/name&wrap=yes
>>>> works fine but
>>>> http://localhost:8984/rest/factbook?query=//city/name&wrap=yes&method=json
>>>> returns [BXJS0002] JSON serializer: <json> expected as root node.
>>>>
>>>> I don't understand why. I need json serialization whatever is the XML
>>>> returned by the query.
>>>>
>>>> And I don't understand how to use the json options via the REST API.
>>>> http://docs.basex.org/wiki/JSON_Module
>>>> An example could be fine to help.
>>>>
>>>> Best regards
>>>>
>>>> Florent
>>>>
>>>
>>> --
>>> Dirk Kirsten, BaseX GmbH, http://basex.org
>>> |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz
>>> |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer:
>>> |   Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle
>>> `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
>>
>>
>>
>> --
>> FLOSS Engineer & Lawyer
>
>
>
> --
> FLOSS Engineer & Lawyer



-- 
FLOSS Engineer & Lawyer

Reply via email to