Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax: Json vs XML

Tags:

json

ajax

xml

With the exception of needing an XML file, is there a benefit to using XML over JSON? JSON seems like an easier way to handle a return but I have very little experience using one or the other

like image 786
Aardvark Avatar asked Jun 30 '10 16:06

Aardvark


1 Answers

XML or JSON When to use these format?

Click here for Link

JSON JSON uses JavaScript syntax for describing data objects, but JSON is still language and platform independent.

JSON is more lighter and efficient than XML

JSON does not provide any display capabilities because it is not a document markup language.

XML

XML’s strength is extensibility and the avoidance of namespace clashes. It holds any data type and can be used to transport full documents with formatting information included. XML is best used when transporting something like a patient chart or text document with markup included.

XML provide display capabilities.

XML structures are based on elements (which can be nested), attributes (which cannot), raw content text, entities, DTDs, and other meta structures.

Finally,

JSON is a better data exchange format. XML is a better document exchange format. Use the right one for the right job.

like image 129
Arun Prakash Avatar answered Oct 20 '22 00:10

Arun Prakash