XML, JSON, or what?

Steve Holden steve at holdenweb.com
Thu Jun 8 06:24:32 EDT 2006


Ant wrote:
>>to use? I could go back to XML, or I could switch to JSON - I have read
> 
> 
> I'd favour JSON if the data structures are simple personally. XML is
> comparatively speaking a pain to deal with, where with JSON you can
> simply eval() the data and you have a Python dictionary at your
> disposal.
> 
Modulo any security problems that alert and malicious users are able to 
inject into your application. Simply using eval() uncritically on 
whatever comes down the pipe is a train wreck waiting to happen.

> I recently used JSON as a way of passing data from a Java backend to a
> web page for Javascript to deal with, with the added side effect that
> my Python testing scripts could also easily read the same data.
> 

Oh, well as ling as we're talking about the *web* that's all right, then :-)

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Love me, love my blog  http://holdenweb.blogspot.com
Recent Ramblings     http://del.icio.us/steve.holden




More information about the Python-list mailing list