Friday, July 1, 2016

Advandage of JSON over XML

  • JSON is more compact and can be easily loaded in JavaScript.
  • Easily consumed by JavaScript  - JSON parsing is generally faster than XML parsing.


  • XML is stricter and has support for schemas and namespaces.


JSON

-› Very simple and lightweight ..

-› Easy in parsing, processing, validating in all languages ..

-› Due to its simplicity, it runs faster and consumes lesser memory ..

-› Hence used in mobile app due to above reasons and also sometimes in transferring data between systems (webservices) ..

XML

-› Standard but slightly heavier ..

-› Parsing, processing and validating are little bit difficult when compared ..

-› Used as a standard format in webservices ..



JSON is smaller, faster and lightweight compared to XML. So for data 
    delivery between servers and browsers, JSON is a better choice.


JSON serializes a very simple model of key/value pairs, where values can be strings, numbers, booleans or arrays. It's not much more than that. As evidenced by it's popularity among web developers, that's more than enough for most folks. 

XML serializes the Document Object Model, which is significantly more complex and comes with a complete programming model rich with events, collections, etc.. The XML DOM supports rich data types (doubles, date, datetime, uri, etc.) which is something that JSON lacks. Namespaces are also handy when multiple schema's declare an element of the same name. This is something that JSON doesn't handle particularly well.

No comments:

Post a Comment

உப்பு மாங்காய்

சுருக்குப்பை கிழவி. சுருக்கங்கள் சூழ் கிழவி. பார்க்கும் போதெல்லாம் கூடையுடனே குடியிருப்பாள். கூடை நிறைய குட்டி குட்டி மாங்காய்கள். வெட்டிக்க...