What is the different between xml and json

+1 vote
I have seen xml and json are standard for transfer data between multiple devices.
Feb 7, 2019 in Others by deepa
• 130 points
223 views

2 answers to this question.

+1 vote

JSON (JavaScript Object Notation)-  A lightweight data-interchange format which is completely language independent. It is based on the JavaScript programming language and easy to generate.

A JSON file will look something like this:-

{"User":[

    { "firstName":"Priyaj", "lastName":"Kumar" },
    { "firstName":"Omkar", "lastName":"Hiremath" },
    { "firstName":"Kalgi", "lastName":"Shah" },

]} 

XML(Extensible Markup Language)- It is used to carry data and not display data. XML is a markup language that is used to define a set of rules for encoding the document in a format that is both human-readable and machine-readable.

The XML file will look something like this:-

<User> 
    <User> 
        <firstName>Priyaj</firstName> <lastName>Kumar</lastName> 
    </User> 
    <User> 
        <firstName>Omkar</firstName> <lastName>Hiremath</lastName> 
    </User> 
    <User> 
        <firstName>Kalgi</firstName> <lastName>Shah</lastName> 
    </User> 
</User> 
answered Feb 7, 2019 by Priyaj
• 58,120 points
ok fine. and thankyou
+1 vote

These are the differences:

 
It is JavaScript Object Notation It is Extensible markup language
It is based on JavaScript language. It is derived from SGML.
It is a way of representing objects. It is a markup language and uses tag structure to represent data items.
It does not provides any support for namespaces. It supports namespaces.
It supports array. It doesn’t supports array.
Its files are very easy to read as compared to XML. Its documents are comparatively difficult to read and interpret.
It doesn’t use end tag. It has start and end tags.
It is less secured. It is more secured than JSON.
It doesn’t supports comments. It supports comments.
It supports only UTF-8 encoding. It supports various encoding.
answered Feb 7, 2019 by Junaid
Thank you @junaid, good explanation.

Related Questions In Others

0 votes
1 answer

What is the difference between hadoop and google analytics ?

I will try and answer this as ...READ MORE

answered Aug 21, 2018 in Others by Frankie
• 9,810 points
475 views
0 votes
1 answer

What is the difference between BASH and DOS?

The major difference between the BASH and ...READ MORE

answered Mar 8, 2019 in Others by Nabarupa
5,315 views
0 votes
1 answer

What is the difference between loadash and underscore

Loadash makes iterating arrays, strings, and objects easy in ...READ MORE

answered Jun 21, 2019 in Others by sunshine
• 1,280 points
205 views
+1 vote
1 answer

what is the difference between error and stderr in Node.js?

Error is an object created by Node.js to handle ...READ MORE

answered Jul 4, 2019 in Others by sunshine
• 1,280 points
535 views
0 votes
1 answer

What is the difference between the Internet, Intranet, and Extranet?

The terminologies Internet, Intranet, and Extranet are ...READ MORE

answered Feb 24, 2020 in Others by anonymous
• 82,720 points
1,473 views
0 votes
1 answer

Xml to Json Conversion

To convert XML File in to JSON ...READ MORE

answered Jan 10, 2019 in Java by developer_1
• 3,310 points
1,170 views
0 votes
1 answer

Code for converting multiple .xml files to .json file format

Hey, @AAron, I would suggest you go through ...READ MORE

answered Dec 18, 2020 in Talend by Gitika
• 65,870 points
252 views
0 votes
1 answer

How to simplify or automate task group creation in TFS?

You can easily import or export task ...READ MORE

answered Apr 25, 2018 in DevOps & Agile by ajs3033
• 7,280 points
660 views
0 votes
1 answer

Parse JSON in Python

import json data=json.loads(employee_data) print(data) READ MORE

answered Apr 26, 2018 in Python by aayushi
• 750 points
393 views
+1 vote
1 answer

What is the difference between Dark Web and Deep Web?

The content that which you cannot find ...READ MORE

answered Feb 6, 2019 in Others by Priyaj
• 58,120 points
216 views