Why XML ?

Today , I stumbled upon this article.

An elaborate XML to JavaScript code , done by some talented M$FT developer.

I wanted to share it with you. Why? Because I think of it as a nice example telling us clearly why is JSON so much better than XML. It all starts with this XML as an example:

image

I got immediately and intensely wondering, why not just ‘store’ these books like this :

 /*  BookList  */
   [
     { Author: "Paul", Price : 10.30 } ,
     { Author: "Joe", Price : 20.95, Title: "Web 2.0" }
   ] ;
/**/

How superior… So, I have to ask again: Why XML ?

2008-12-12 Update

Proper JSON to XML , without any loss of information would be :

/**/
{ BookList : 
   [
 { Author: "Paul", Price : 10.30 } ,
 { Author: "Joe", Price : 20.95, Title: "Web 2.0" } 
   ]
 }
/**/

This when stored does not loose any information that was in XML.

DBJ