| Similarities and difference between JSON and XML
First we will discuss the difference between JSON and XML
(1)JSON:-JSON is JavaScript Object Notation
XML:-XML is Extensible Markup Language
(2)JSON:-Base for JSON is Javascript Language.
XML:-XML is derived from SGML.
(3)JSON:-JSON is the way to represent objects.
XML:-XML uses tag structure to display data items.
(4)JSON:-Doesnot have support for Namespaces.
XML:-XML supports Namespaces.
(5)JSON:-JSON supports array
XML:-XML doesnot support array.
(6)JSON:-JSON files are easy to read in comparison to XML.
XML:-XML files is little bit complex to read and interpret.
(7)JSON:-JSON doesnot use end tag and its shorter.
XML:-XML have both start and end tag.
(8)JSON:-JSON is less secured then XML.
XML:-XML is more secured than JSON.
(9)JSON:-JSON will not support comments.
XML:-XML supports comments.
(10)JSON:-JSON supports only UTF-8 encoding.
XML:-XML supports various encoding.
(11)JSON:-JSON can be parsed by a standard JavaScript function.
XML:-XML has to be parsed with an XML parser.
Now comes to similarities between JSON and XML
(1)Both of these are self describing
(2)Both of these are hierarchical
(3)Both of these are parsed and used by lots of programming languages
(4)Both of these can be fetched with an XMLHttpRequest | | |