- Extensible Markup Language (XML) is a text format derived from SGML. Compared to SGML, XML is simple. HyperText Markup Language (HTML), by comparison, is even simpler.
- Unfortunately, XML is not well suited to data-interchange. It carries a lot of baggage, and it doesn't match the data model of most programming languages.
- The most informed opinions on XML suggest that XML has big problems as a data-interchange format, but the disadvantages are compensated for by the benefits of interoperability and openness.
- JSON promises the same benefits of interoperability and openness, but without the disadvantages.
JSON Alternative to XML
1.Simplicity:- XML is simpler than SGML, but JSON is much simpler than XML. JSON has a much smaller grammar and maps more directly onto the data structures used in modern programming languages.
2.Extensibility:- JSON is not extensible because it does not need to be. JSON is not a document markup language, so it is not necessary to define new tags or attributes to represent data in it.
3.Interoperability:- JSON has the same interoperability potential as XML.
4.Openness:- JSON is at least as open as XML, perhaps more so because it is not in the center of corporate/political standardization struggles.
6.XML separates the presentation of data from the structure of that data:- XML requires translating the structure of the data into a document structure. This mapping can be complicated. JSON structures are based on arrays and records. That is what data is made of. XML structures are based on elements (which can be nested), attributes (which cannot), raw content text, entities, DTDs, and other meta structures.
7. Open and extensible:- one-of-a-kind open structure allows you to add other state-of-the-art elements when needed. This means that you can always adapt your system to embrace industry-specific vocabulary. Those vocabularies can be automatically converted to JSON, making migration from XML to JSON very straightforward.