Json And Xml
by {"name"=>"Vuyisile Weni"}
#JSON vs XML.
XML and JSON can bothe be use to recieve data from a web server, but the is a difference between the two even though they can be used to perform the same task.
-
XML is a mark-up language and JSON is a way of representing objects.
-
XML uses attributes to structure and contain the data, while JSON uses objects and proparties to do the same.
-
JSON doesn’t use end tags like XML, which is part of what makes it’s syntax shorter than XML.
-
JSON is easier to read and write.
-
XML has to be parsed with an XML parser and JSON can be parsed by a standard JavaScript function, meaning XML is much more difficult to parse than JSON. JSON is parsed into a ready-to-use JavaScript object.
-
JSON supports datatype and arrays, while XML does not provide datatype and does not support array.
-
XML support for Namespaces and Comments while JSON does not support Namespaces and comments.