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 in Others by deepa
• 130 points
57 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 by Priyaj
• 56,900 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 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
58 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 in Others by Nabarupa
215 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 in Others by sunshine
• 1,240 points
68 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 in Others by sunshine
• 1,240 points
63 views
0 votes
2 answers

What is white box testing and how is it different from black box testing?

Black Box Testing is a software testing method in ...READ MORE

answered Feb 20 in Others by preetiagarwal
• 170 points
62 views
0 votes
1 answer

Xml to Json Conversion

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

answered Jan 10 in Java by developer_1
• 3,300 points
198 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
276 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
90 views
0 votes
1 answer

How to import data from a Json file into R?

Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE

answered Apr 26, 2018 in Data Analytics by DeepCoder786
• 1,720 points
197 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 in Others by Priyaj
• 56,900 points
67 views