Comparison of JSON and XML Response – Quick Tips

Author: | Posted in PHP, Quick Tips, Technology No comments
Below is the Comparison of JSON and XML Response
json-vs-xml-quicktips

JSONPro:

Simple syntax, which results in less “markup” overhead compared to XML.
Easy to use with JavaScript as the markup is a subset of JS object literal notation and has the same basic data types as JavaScript.
Con: Simple syntax, only a handful of different data types is supported.

FEATURES OF JSON

1.Size | Small

2. Parsing | Take less time

3. Extensibility | Limited to text only.

4. Performance | Good

 

 

XML

Pro:

Generalized markup, it is possible to create “dialects” for any kind of purpose
XML Schema for datatype, structure validation. Makes it also possible to create new datatypes.
XSLT for transformation into different output formats.
XPath/XQuery for extracting information (which makes getting information in deeply nested structures much easier then with JSON).
Con:

Relatively wordy compared to JSON (results in more data for the same amount of information).

FEATURES OF XML

1.Size | Big

2. Parsing | Take more time

3. Extensibility | Support multiple date type

4. Performance | Bad