Issues with new json xml function and copy clause
Thursday, 28 May 2015 · 2 messages · last reply 29 May 2015
JW
James Wright28 May 2015 20:39 #
I am having issues with the new json-to-xm functions with a copy clause.
I would expect the following query to work:
*let $json := '{"age":23,"name":"Bob"}'return copy $out :=
json-to-xml($json) modify delete node $out//*[@key='age'] return
xml-to-json($out)*Instead I get an error when calling xml-to-json: [FOJS0006] Element 'map' has invalid namespace: ''.
It appears the copy clause is dropping the namespace on the map object. Is this something I must manually prevent or a bug?
Thanks for all your time.
- James
CG
Christian Grün29 May 2015 12:25 #
James, thanks for the hint. The bug has been fixed [1].
All the best, Christian
[1] http://files.basex.org/releases/latest
Quoted text · James Wright · 18 lines
On Thu, May 28, 2015 at 6:39 PM, James Wright <balugajames at gmail.com> wrote: > I am having issues with the new json-to-xm functions with a copy clause. > > I would expect the following query to work: > let $json := '{"age":23,"name":"Bob"}' > return > copy $out := json-to-xml($json) > modify delete node $out//*[@key='age'] > return xml-to-json($out) > > Instead I get an error when calling xml-to-json: [FOJS0006] Element 'map' > has invalid namespace: ''. > > It appears the copy clause is dropping the namespace on the map object. Is > this something I must manually prevent or a bug? > > Thanks for all your time. > - James
Written for BaseX 8.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery