fetch:text('https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json')=> parse-json() (: Convert to XQuery item representation :)=> array:for-each(function($map){ (: For each entry in that array, do :)element item { (: Construct an XML element named item :)$map => map:keys()=> for-each(function($key){ (: For each key in the map, do: :)element { $key } { (: Return an element named $key :)$map($key) (: …and the value of $map($key) :)}})}})=> array:flatten() (: Converts the array to a sequence :)
For more info on our BaseX JSON-Module see: http://docs.basex.org/wiki/JSON_Modulefetch:text('https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json')=> json:parse()
Am 19.11.2017 um 06:25 schrieb E. Wray Johnson <wray.johnson@gmail.com>:I have a JSON fileI want to load it into a database in a different XML format where I can use gml:Point in place of longitude and latitude as separate elements. However my for loop does not emit individual XML elements for each json object in the loaded array.
https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json