JSON representation (was Re: Fwd: Re: Agenda 2014-09-17

So, here are some examples using object="true""

{}
<json object="true"/>

[]
<json array="true"/>

""
<json type="string"/>

"0"
<json type="string">0</json>

0
<json type="number">0</json>

{p:0}
<json object="true"><p type="number">0</p></json>

{p:""}
<json object="true"><p type="string"/></json>

{p:[]}
<json object="true"><p array="true"/></json>

{p:{}}
<json object="true"><p object="true"/></json>

{p:[[]]}
<json object="true"><p array="true"><_ name="" array="true"/></p></json>

{p:[{}]}
<json object="true"><p array="true" object="true"/></json>

{p:[{q:0}]}
<json object="true"><p array="true" object="true"><q  
type="integer">0</q></p></json>

Steven

On Wed, 17 Sep 2014 16:18:29 +0200, Steven Pemberton  
<Steven.Pemberton@cwi.nl> wrote:

>
>
> ------- Forwarded message -------
> From: "Steven Pemberton" <steven.pemberton@cwi.nl>
> To: "alain.couthures@agencexml.com" <alain.couthures@agencexml.com>
> Cc:
> Subject: Re: Agenda 2014-09-17
> Date: Wed, 17 Sep 2014 16:15:49 +0200
>
> On Wed, 17 Sep 2014 15:32:13 +0200, alain.couthures@agencexml.com  
> <alain.couthures@agencexml.com> wrote:
>
>>
>>> Le 17 septembre 2014 à 15:20, Steven Pemberton  
>>> <Steven.Pemberton@cwi.nl> a écrit :
>>>
>>>>   {"p": [[]]}
>>> <json><p array="true"/><_ name="" type="array"/></json>
>>
>> <json><p array="true"><_ name="" array="true"/></p></json>
>>
>> Is that right?
>>>  But this one, I don't think is covered properly:   {"p": [{}]}  
>>> because the current description doesn't distinguish between this and   
>>>    {"p": []} that is between an empty array, and an array containing  
>>> just an empty object. Ideas?
>>>
>>
>> <json><p array="true"><_ name="" object="true"/></p></json>
> That would mean we would have to add object="true" too all objects,  
> since it would be possible to delete all children of an object.
>
>>
>> while {} is converted to <json/>, right?
>
> Currently, yes.
>
> Steven
>>
>> --Alain

Received on Wednesday, 17 September 2014 14:56:52 UTC