Dear all,
I’m trying to get data out of json via xquery. This is my scenario: 1. Fetching data with fetch:text() calling a REST-API 2. Transforming the data with json-to-xml, so I’ll get something like <array xmlns="http://www.w3.org/2005/xpath-functions%E2%80%9C%3E <map> <string key=„word1“>gehen</string> ... </map> ... </array> 3. In my xqm-file I have: let $json_xml := json-to-xml(my_fetched_json) 4. I try to get „gehen“ with $json_xml//string[@key='word1‘], but it yields nothing, also $json_xml//string yields nothing. Only $json_xml//text() yields all string-values into a long string.
What am I doing wrong? Or is there another way, to work with JSON-Data to get values of a given key?
Thanks in advance, Günter