[Ocs] JSON spec

Mohd Izhar Firdaus Ismail kagesenshi.87 at gmail.com
Thu Feb 9 12:28:12 PST 2012


On Fri, Feb 10, 2012 at 3:35 AM, Laszlo Papp <lpapp at kde.org> wrote:
>> This format specification should be less flaky i believe.
>> http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
>
> I personally prefer this way:
>
> XML:
>        <e name="value">text</e>
>
> JSON:
>       "e": [ {"@name": "value"} , "text"] instead of "e": { "@name":
> "value", "#text": "text" }

erm .. "e": [ {"@name": "value"} , "text"] can also be interpreted as:

<e name='value'></e>
<e>text</e>

i think it'll be tricky determine when a list should be a single node,
or when it should be a list of nodes.

at least #text is consistent with xpath even if it might be a bit
ugly. also a parser written using the suggested xml.com format can
also be reused for other stuff.

anyway looking through the spec, the only time #text is needed is for
<icon>, for everything else, they are nodes without #text. so the
effect wouldnt be that bad imo..


-- 
Mohd Izhar Firdaus Bin Ismail / KageSenshi
Inigo Consulting (FOSS/Plone Development, Training & Services)
http://www.inigo-tech.com
Fedora Malaysia Contributor & Ambassador
http://blog.kagesenshi.org
92C2 B295 B40B B3DC 6866  5011 5BD2 584A 8A5D 7331


More information about the Ocs mailing list