Hi Christian, hi Martin,
I checked the response-typ. It's "document-node()".
The structure is like this: <json type="object"> <result type="array"> <_ type="object"> <id>ba03177</id> <score type="number">0.83175087</score> <metadata type="object"> <genre>ba</genre> <blatt>1810-40</blatt> <autor>Heinrich von Kleist</autor> <titel>Die heilige Cäcilie</titel> <link> "https://kleist-digital.de/berliner-abendblaetter-etc" <text>Die Aebtissinn , die schon, in der Stunde der Mitternacht, durch einen Freund, von der Gefahr, etc</text> </metadata> <!--_--> etc.
I hope this helps. How to parse it, to get my proposed html-structure?
Thanks for further help.
Günter
Am 25.04.2024 um 23:08 schrieb Christian Grün christian.gruen@gmail.com:
Hi Günter,
- I'm getting a full Object (but I dont know, if its the raw JSON-Object like above), but I am not able, to parse it, to get a list in html.
Could you share the result of your response with us (possibly shortened)?
It would be interesting to learn something about the type of the response body. What do you get if you inspect:type($response[2]) ?
let $data := json:parse($input, map { 'format': 'xquery' }) return map:for-each($data, function($k, $v) { $k || ': ' || string-join($v, ', ') })
If you use json:parse($input) without a specific format, you’ll get an XML representation of the JSON data, which is usually simpler to postprocess.
Hope this helps Christian