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
1,608 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,020 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 22, 2018 in Others by Frankie
• 9,830 points
1,636 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
17,026 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,300 points
1,105 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,300 points
2,450 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,840 points
2,643 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,350 points
2,406 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,770 points
2,845 views
0 votes
0 answers

Using XML with REST API through Azure Datafactory V2

I need to use a REST API ...READ MORE

Feb 15, 2023 in Azure by Damonlang
• 1,230 points
798 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,300 points
1,941 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,020 points
1,206 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP