Difference between XML and JSON (XML vs. JSON)
Introduction
JSON (JavaScript Object Notation), is an open-standard file format used for data interchange. It can store human-readable text. XML, on the other hand, is a well-known markup language that provides data in an organized and easy-to-understand manner. It is case-sensitive and offers developers to establish markup elements and produce customized markup language. Both JSON & XML uses the same concept to transfer data from client to server and vice versa. In this article, you will learn about the difference between XML and JSON.
XML vs. JSON –
Example of JSON –
{
“firstName” : “Mr. Karlos”,
“lastName” : “Ray”
“designation” : [“Researcher”, “Author”, “Security Engineer”, “Programmer” ]
}
Example of XML –
<Employee>
<FirstName> Mr. Karlos </FirstName>
<LastName> Ray </LastName>
<Designation>
<Details> Researcher </Details>
<Details> Author </Details>
<Details> Security Engineer </Details>
<Details> Programmer </Details>
</Designation>
</Employee>
Wrapping Up -
Although both are used these days, JSON gained popularity because of its easy-to-use nature and works more with less. Developers can learn both of these techniques as both require a day or two to understand and leverage them.