0
2.4kviews
Short note on JSON Alternative to XML

Subject: Advanced Internet Technology

Topic: RIA and Mashup

Difficulty: High

1 Answer
1
10views

Introduction

  • 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.
  • There is another text notation that has all of the advantages of XML, but is much better suited to data-interchange. That notation is JavaScript Object Notation (JSON).
  • 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.

5. There is a wide range of reusable software available to programmers to handle XML so they don't have to re-invent code:- JSON, being a simpler notation, needs much less specialized software. In the languages JavaScript and Python, the JSON notation is built into the programming language; no additional software is needed at all. In other languages, only a small amount of JSON-specific code is necessary.

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.

Please log in to add an answer.