[Context.RWG] Using JSON instead of XML for OGC documents

Cameron Shorter cameron.shorter at gmail.com
Thu Nov 16 22:55:35 EST 2006


Without trying to claim to be a JSON expert, I found this link which 
suggests that JSON can be used to display nested structures.
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html

XML:
<e>
   <a>text</a>
   <b>
     <c>text</c>
   </b>
</e>

JSON:
"e": {
   "a": "text",
   "b": {
     "c": "text"
   }
}

Joshua Lieberman wrote:
> A quick look suggests that JSON is lightweight and easy because it's -- 
> KVP. It may be easy to pass and to process but there are reason's (total 
> obscuration of document structure, etc.) that XML has been preferred for 
> more complex messages. One can certainly deconvolve XML into an infoset 
> representation to serialize in KVP, but it can't be any easier to 
> process nested structures in this format and probably is harder.
> 
> Now this can be taken the other way as a reason among others to maintain 
> and update KVP bindings for which JSON would be straightforward and 
> appropriate, and not be drawn into complex SOAP + XML for all 
> client-server interactions.
> 
> As far as providing an alternate KVP serialization of such things as 
> context documents, I'm open to the possibility, but it does seem in 
> principle to be intended for richly hierarchical content, perhaps not 
> the best candidate for JSON.
> 
> Josh
> 
> Joshua Lieberman, Ph.D.
> 
> Principal, Traverse Technologies Inc.
> 
> mailto:jlieberman at traversetechnologies.com
> 
> tel +1 (617) 395-7766
> 
> fax: +1 (815) 717-981
> 
> 
> 
> On Nov 16, 2006, at 5:34 PM, Cameron Shorter wrote:
> 
>> Context working group,
>>
>> Regarding: http://json.org
>>
>> There has been discussion amongst http://openlayers.org developers about 
>> using JSON instead of XML for storing OGC documents (like OGC Context, 
>> WMC, and probably a host of other documents too).
>>
>> The reason for considering JSON over XML are:
>> * In Web Browsers, XML support is patchy.
>> * Consequently extra code is required to be downloaded to cover all 
>> browsers.
>> * In browser clients, code size is a major consideration as 
>> size=bandwidth=speed.
>> * JSON is reportedly faster to process.
>>
>> JSON reportedly has all the other advantages of XML like being 
>> structured, easy to read, is supported by multiple languages etc.
>>
>> One thing discussed is standing up XML<->JSON services.
>>
>> I'd be interested to hear comments from OGC participants on these ideas.
>>
>> Feel free to foward onto others more appropriate.
>>
>> --
>> Cameron Shorter
>> http://cameron.shorter.net
>> _______________________________________________
>> Context.rwg mailing list
>> Context.rwg at opengeospatial.org <mailto:Context.rwg at opengeospatial.org>
>> https://mail.opengeospatial.org/mailman/listinfo/context.rwg
> 
> 


-- 
Cameron Shorter
http://cameron.shorter.net




More information about the Mail_webmap-discuss mailing list