Hi I shall export JSON file based on XML structures I have in my XQuery. Here I found http://demo.exist-db.org/xquery/json-test.xql/source sample, how eXistDB can produce JSON data.
It is like
import module namespace json="http://www.json.org"; 04. 05.declare option exist:serialize "method=xhtml media-type=text/html";
let $xml1 := 08.<root> 09.<h1>H</h1> 10.<p/> 11.<p>some text</p> 12.<h2>HH</h2> 13.</root>
<script type="text/javascript"> 43.var data1 = {json:xml-to-json($xml1)};
BaseX does not provide this and I wonder, what options I have and what would anyone recommend
1. building up plain text piece by piece by XQuery 2. using some Java lib for this (there are more, any practical experience welcome) 3. Some other trick, which lives hidden to me (I already queried BaseX wiki and no hit)
Jan