JSON/XML mapping

Wednesday, 18 April 2012 · 4 messages · last reply 21 Apr 2012
HR
Hans-Juergen Rennau18 Apr 2012 20:57 #
Hello, I have a couple of questions concerning the XML/JSON mapping, described in the documentation JSON Module/JSON Functions. 1) 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? 2) 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? Thank you very much. Hans-Juergen
CG
Christian Grün19 Apr 2012 00:07 #
Dear Hans-Juergen,
Quoted text · Hans-Juergen Rennau · 5 lines
> 1) 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.
Quoted text · Hans-Juergen Rennau · 3 lines
> 2) 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
HR
Hans-Juergen Rennau20 Apr 2012 18:36 #
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
Quoted text · Christian Grün · 18 lines
Von: Christian Grün <christian.gruen at gmail.com> An: Hans-Juergen Rennau <hrennau at yahoo.de> CC: "basex-talk at mailman.uni-konstanz.de" <basex-talk at mailman.uni-konstanz.de> Gesendet: 0:07 Donnerstag, 19.April 2012 Betreff: Re: [basex-talk] JSON/XML mapping Dear Hans-Juergen, > 1) 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. > 2) 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
CG
Christian Grün21 Apr 2012 02:56 #
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
Quoted text · Hans-Juergen Rennau · 38 lines
On Fri, Apr 20, 2012 at 6:36 PM, Hans-Juergen Rennau <hrennau at 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 at gmail.com> > An: Hans-Juergen Rennau <hrennau at yahoo.de> > CC: "basex-talk at mailman.uni-konstanz.de" > <basex-talk at mailman.uni-konstanz.de> > Gesendet: 0:07 Donnerstag, 19.April 2012 > Betreff: Re: [basex-talk] JSON/XML mapping > > Dear Hans-Juergen, > >> 1) 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. > >> 2) 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 > >

⚡Generated with XQuery