Why JSON over XML ?

XML(Extensible Markup Language) is widely used for data storing and exchanging/transferring irrespective of machine or operating system platform. It has some structure with nodes and attributes and follows simple syntax. Data is set using these and thus very structured to interpret at destination. There is XML parser who parses the XML data. It also has END tag to notify the parser about the end. And thus you can conclude that there are END tag types some other reserved words also present. A java developed application can sent data in XML to C# language built application and vice-versa and thus information exchange is hassle free.

JSON (Java Script Object Notation) is syntax and can be said a data transfer pattern like XML but it is very simple as compare to XML’s structuring with nodes and attributes. It doesn’t have tag or nodes so, it is simple and smaller than XML. Due to this, it can be easily understand and self describing notation. We can say, it is very easy to parse and faster to interpret. It uses Array also. It is language independent and even our JavaScript’s eval() parses it easily.  Since it is simple, it is light and got a good fame.

You can have a look into XML & JSON notation format of a data.

XML Notation: (without root level node) 

<?xml version="1.0" encoding="UTF-8" ?>
	<Standard>Fourth Grade</Standard>

JSON notation:

  "Result": "Passed",
  "Standard": "Fourth Grade",
  "RollNumbers": [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]

Thanks for reading!!!