Douglas Crockford specified the JSON format in the early 2000s. The official website was launched in 2002. In December 2005, Yahoo! starts offering some of its web services in JSON. JSON became an ECMA international standard in 2013. The most updated JSON format standard was published in 2017.
History of XML
Here, are the important landmark from the history of XML:
XML was also derived from SGML. Version 1.0 of XML was released in February 1998. Jan 2001:IETF Proposed Standard: XML Media Types XML is the Extensible Markup Language. 1970: Charles Goldfarb, Ed Mosher, and Ray Lorie invented GML The development of XML started in the year 1996 at Sun Microsystem
Features of JSON
Easy to use – JSON API offers high-level facade, which helps you to simplify commonly used use-cases. Performance – JSON is quite fast as it consumes very less memory space, which is especially suitable for large object graphs or systems. Free tool – JSON library is open source and free to use. Doesn’t require to create mapping – Jackson API provides default mapping for many objects to be serialized. Clean JSON – Creates clean, and compatible JSON result that is easy to read. Dependency – JSON library does not require any other library for processing.
Features of XML
XML tags are not predefined. You need to define your customized tags. XML was designed to carry data, not allows you to display that data. Mark-up code of XML is easy to understand for a human. Well, the structured format is easy to read and write from programs. XML is an extensible markup language like HTML.
Difference between JSON and XML
Difference between JSON and XML Here is the prime difference between JSON vs XML:
JSON Code vs XML Code
Let’s see a sample JSON Code
Advantages of using JSON
Here are the important benefits/ pros of using JSON:
Provide support for all browsers
Easy to read and write
Straightforward syntax
You can natively parse in JavaScript using eval() function
Easy to create and manipulate
Supported by all major JavaScript frameworks
Supported by most backend technologies
JSON is recognized natively by JavaScript
It allows you to transmit and serialize structured data using a network connection.
You can use it with modern programming languages.
JSON is text which can be converted to any object of JavaScript into JSON and send this JSON to the server.
Advantages of using XML
Here are significant benefits/cons of using XML:
Makes documents transportable across systems and applications. With the help of XML, you can exchange data quickly between different platforms. XML separates the data from HTML XML simplifies platform change process Allows creating user-defined tags.
Disadvantages of using JSON
Here are cons/ drawback of using JSON:
No namespace support, hence poor extensibility Limited development tools support It offers support for formal grammar definition
Disadvantages of using XML
Here, are cons/ drawbacks of using XML:
XML requires a processing application The XML syntax is very similar to other alternatives ‘text-based’ data transmission formats which is sometimes confusing No intrinsic data type support The XML syntax is redundant
Now, you can easily determine between XML or JSON which is better suitable for you.