JSON versus XML

Both JSON and XML are simple, open, and interoperable. Since JSON usually contains less data, by using JSON, less data traverses through the network. Both formats are human-readable; JSON is a bit cleaner, since it contains less text. This is because the number of data formats supported by JSON is much smaller than with XML.

JSON is handy for sharing data. Data in JSON is stored in arrays and objects while XML documents form a tree structure. Therefore, data transfer is easier with JSON and native for many programming languages: JavaScript, Python, Perl, Ruby, and so on. On the other hand, XML can store more data types (JSON does not have even a data type for date); it can include photos, videos, and other binary files. XML is more robust and it is better suited for complex documents. XML also offers options for data representation, while JSON just transfers data, without suggesting or defining how to display it.

Generally, JSON is better as a data exchange format, while XML is more convenient as a document exchange format.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.137.59