Dear Hans-Juergen,
it's true, JSON names and values may contain characters that have no valid equivalent in XML 1.0 (such as the backspace character [1]) or cannot be represented in QNames. As you already wrote, in the W3C there is an ongoing discussion on how to best represent JSON in XQuery. I haven't followed the last discussions, but as far as I know, there is no decision if JSON names should be represented as element names; instead, they could as well be stored in a (yet to be standardized) map structure, similar to Michael Kay's proposal which we implemented in BaseX, in which case they would have to be mapped differently than QNames.
I hope this is a helpful hint? Christian
[1] http://www.json.org/ [2] http://docs.basex.org/wiki/Map_Module ___________________________
On Fri, Apr 20, 2012 at 6:36 PM, Hans-Juergen Rennau hrennau@yahoo.de wrote:
Thank you, Christian! And one more question.
You use a bidirectional mapping between JSON names and XML names. So does MarkLogic (MLJSON), and I think others too. Is there any W3C work in progress which aims at a standardization of this JSON/XML name mapping? I think it might deserve a miniature spec.
Kind regards, Hans-Juergen
Von: Christian Grün christian.gruen@gmail.com An: Hans-Juergen Rennau hrennau@yahoo.de CC: "basex-talk@mailman.uni-konstanz.de" basex-talk@mailman.uni-konstanz.de Gesendet: 0:07 Donnerstag, 19.April 2012 Betreff: Re: [basex-talk] JSON/XML mapping
Dear Hans-Juergen,
- The text says: "As arrays have no names, <value/> is used as element
name." But I suppose it should be "array members", rather than "arrays", as an array may of course be associated with a name as any other JSON item. Correct?
thanks for the hint; I have updated our documentation.
- So are there all in all 6 reserved attributes names (type, numbers,
booleans, nulls, objects, arrays) and 2 reserved element names (json, value)? Or have I forgotten some names?
Exactly, these should be all of them.
Feel free to ask for more, Christian