Hi Florent,
I have some data in XML format with daily updates. I don't control this data, they come to me as XML, I don't want to convert them and make some mistakes, so I want to use a XML database. If I just add a <json/> element as root, I fix nothing about the string/integer conversion so I don't understand in what this is useful. And if XML only has strings there's no problem to go to JSON, they become strings in JSON !
While this might be true in your _specific_ case, it is not true in general. Even if you only have strings and don't care about numbers, other people do very much care about that. So we need to provide a mapping. Also the <json objects="json" /> element already adds mapping information, as it also could be <json arrays="json"/>. In the first case you get back an JSON object, in the latter one an array. How could we be able to determine that without any mapping information?
You will never be able to do a totally automatical lossless JSON<>XML conversion. However, you are able to write your own mapping functions which are useful for your specific use case
I have seen RestXQ which is probably excellent but it can't help me, because I just want a REST interface with JSON, so I can change my backend without frontend modificiation if needed.
I don't really get your argument here. RestXQ enables you to build a REST interface and you can in fact change your backend without any frontend modifications. In fact, it is much better at this job than the REST interface. As you already discovered, sometimes parameters in newer versions of BaseX change. Using REST you will have to update all REST calls in your frontend. Using RestXQ, you simply adopt your backend code. Also, you would not need all the format information in each and every REST call, as they would be defined in your backend RestXQ code.
I agree with you that the new options syntax for JSON output might be more verbose in this case. But it also gives much more flexibility and is much easier to handle especially in a RestXQ context and I am very happy we have this new syntax. Please also keep in mind that the majority of our users are using RestXQ rather than REST. As I already indicated I personally don't see many good reasons to use REST instead of RestXQ for application development. Hence, I very much doubt that we will switch back to the old method=jsonml syntax.
Cheers, Dirk