SlideShare a Scribd company logo
2
Most read
5
Most read
7
Most read
All about XML, JSON and related topics..
 JSON stands for JavaScript object notation. JSON has been derived from javascript, where
javascript is a programming language. It was originally created to hold the structured data that
could be used in javascript. JSON became so popular that it is used for data for all kinds of
applications. It is the most popular way of sending the data for Web APIs.
 Basic data types supported by JSON are:
1. Strings: Characters that are enclosed in single or double quotation marks.
2. Number: A number could be integer or decimal, positive or negative.
3. Booleans: The Boolean value could be either true or false without any quotation marks.
4. Null: Here, null means nothing without any quotation marks.
WHAT IS XML?
 XML stands for an extensible markup language. It is like HTML, where HTML stands for
Hypertext Markup language. HTML is used for creating websites, whereas XML can be used
for any kind of structured data.
 XML has two ways of handling data, i.e., Tags and Attributes. The tags work as HTML. The
start tags start with the <_> and end with the </_>. The start and end tags must match. The
names must only be letters, numbers, and underscore, and the tag name must start with a letter
only.
SIMILARITIES BETWEEN THE
JSON AND XML.
1. Self-describing: Both json and xml are self-describing as both xml data and json data are
human-readable text.
2. Hierarchical: Both json and xml support hierarchical structure. Here hierarchical means
that the values within values.
3. Data interchange format: JSON and XML can be used as data interchange formats by
many different programming languages.
4. Parse: Both the formats can be easily parsed.
5. Retrieve: Both formats can be retrieved by using HTTP requests. The methods used for
retrieving the data are GET, PUT, POST.
DIFFERENCES BETWEEN THE
JSON AND XML.
JSON XML
JSON stands for javascript object notation. XML stands for an extensible markup language.
The extension of json file is .json. The extension of xml file is .xml.
The internet media type is application/json. The internet media type is application/xml or text/xml.
The type of format in JSON is data interchange. The type of format in XML is a markup language.
It is extended from javascript. It is extended from SGML.
It is open source means that we do not have to pay
anything to use JSON.
It is also open source.
The object created in JSON has some type. XML data does not have any type.
he data types supported by JSON are strings, numbers,
Booleans, null, array.
XML data is in a string format.
It does not have any capacity to display the data. XML is a markup language, so it has the capacity to display
the content.
JSON has no tags. XML data is represented in tags, i.e., start tag and end tag.
XML file is larger. If we want to represent the data in XML
then it would create a larger file as compared to JSON.
JSON is quicker to read and write. XML file takes time to read and write because the learning
curve is higher.
JSON can use arrays to represent the data. XML does not contain the concept of arrays.
It can be parsed by a standard javascript function. It has to be
parsed before use.
XML data which is used to interchange the data, must be
parsed with respective to their programming language to use
that.
It can be easily parsed and little bit code is required to parse
the data.
It is difficult to parse.
File size is smaller as compared to XML. File size is larger.
JSON is data-oriented. XML is document-oriented.
It is less secure than XML. It is more secure than JSON.
 The JSON syntax is a subset of the JavaScript syntax.
JSON Syntax Rules
1. JSON syntax is derived from JavaScript object notation syntax:
2. Data is in name/value pairs
3. Data is separated by commas
4. Curly braces hold objects
5. Square brackets hold arrays
JSON DATA - A NAME
 JSON data is written as name/value pairs (aka key/value pairs).
 A name/value pair consists of a field name (in double quotes), followed by a colon, followed
by a value:
 Example
"name":"John"
JSON VALUES
 In JSON, values must be one of the following data types:
1. a string
2. a number
3. an object
4. an array
5. a boolean
6. null
 In JavaScript values can be all of the above, plus any other valid JavaScript expression, including:
1. a function
2. a date
3. undefined
 In JSON, string values must be written with double quotes:
 JSON
{"name":"John"}
 In JavaScript, you can write string values with double or single quotes:
 JavaScript
{name:'John'}
JSON OBJECT LITERALS
 This is a JSON string:
'{"name":"John", "age":30, "car":null}'
 Inside the JSON string there is a JSON object literal:
{"name":"John", "age":30, "car":null}
 JSON object literals are surrounded by curly braces {}.
 JSON object literals contains key/value pairs.
 Keys and values are separated by a colon.
 Keys must be strings, and values must be a valid JSON data type:
1. string
2. number
3. object
4. array
5. boolean
6. null
 Each key/value pair is separated by a comma.
JSON ARRAY LITERALS
 This is a JSON string:
'["Ford", "BMW", "Fiat"]'
 Inside the JSON string there is a JSON array literal:
["Ford", "BMW", "Fiat"]
 Arrays in JSON are almost the same as arrays in JavaScript.
 In JSON, array values must be of type string, number, object, array, boolean or null.
 In JavaScript, array values can be all of the above, plus any other valid JavaScript expression,
including functions, dates, and undefined.

More Related Content

What's hot (20)

PPTX
Database Access With JDBC
Dharani Kumar Madduri
 
PPTX
oops concept in java | object oriented programming in java
CPD INDIA
 
PDF
Function in C
Dr. Abhineet Anand
 
PDF
Run time storage
Rasineni Madhan Mohan Naidu
 
PPTX
Function in c
Raj Tandukar
 
PPTX
C Programming Unit-4
Vikram Nandini
 
PPTX
Function in c
CGC Technical campus,Mohali
 
PPT
Strings v.1.1
BG Java EE Course
 
PDF
Wrapper classes
Ravi_Kant_Sahu
 
PPT
Chapter 4 strings
Chv Raghavendran
 
PPT
Chapter 6 intermediate code generation
Vipul Naik
 
PPT
Unit 2 Principles of Programming Languages
Vasavi College of Engg
 
PPTX
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dhrumil Panchal
 
PPTX
Form Validation in JavaScript
Ravi Bhadauria
 
PPT
02 xml schema
Baskarkncet
 
PPTX
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
SKUP1
 
PPTX
jstl ( jsp standard tag library )
Adarsh Patel
 
PPTX
File handling
priya_trehan
 
PPTX
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
Database Access With JDBC
Dharani Kumar Madduri
 
oops concept in java | object oriented programming in java
CPD INDIA
 
Function in C
Dr. Abhineet Anand
 
Run time storage
Rasineni Madhan Mohan Naidu
 
Function in c
Raj Tandukar
 
C Programming Unit-4
Vikram Nandini
 
Strings v.1.1
BG Java EE Course
 
Wrapper classes
Ravi_Kant_Sahu
 
Chapter 4 strings
Chv Raghavendran
 
Chapter 6 intermediate code generation
Vipul Naik
 
Unit 2 Principles of Programming Languages
Vasavi College of Engg
 
Dynamic Programming Code-Optimization Algorithm (Compiler Design)
Dhrumil Panchal
 
Form Validation in JavaScript
Ravi Bhadauria
 
02 xml schema
Baskarkncet
 
C-Programming C LIBRARIES AND USER DEFINED LIBRARIES.pptx
SKUP1
 
jstl ( jsp standard tag library )
Adarsh Patel
 
File handling
priya_trehan
 
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 

Similar to All about XML, JSON and related topics.. (20)

PDF
Dealing with JSON files in python with illustrations
Kiran Kumaraswamy
 
PPTX
LU 1.3. JSON & XML.pptx about how they work and introduction
niyigenagilbert6
 
PDF
Intro to JSON
George McKinney
 
PPTX
JSON_FIles-Py (2).pptx
sravanicharugundla1
 
PPT
Java Script Object Notation (JSON)
Adnan Sohail
 
PPTX
Intro to JSON
Mark Daniel Dacer
 
PPTX
JSON - (English)
Senior Dev
 
PDF
Json
soumya
 
PDF
JSON Data Parsing in Snowflake (By Faysal Shaarani)
Faysal Shaarani (MBA)
 
PPTX
JSON
Zara Tariq
 
PPTX
JSON.pptx
TilakaRt
 
DOCX
Json1
thetechbuddyBlog
 
PPT
json
prabhatjon
 
DOCX
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
codeandyou forums
 
PDF
JSON beautifier (1).pdf
json beautifier
 
PPTX
Web Fundamentals: JavaScript Objects Json and XML
kategeg121
 
PPTX
An introduction to json
Naveenkumar5964
 
Dealing with JSON files in python with illustrations
Kiran Kumaraswamy
 
LU 1.3. JSON & XML.pptx about how they work and introduction
niyigenagilbert6
 
Intro to JSON
George McKinney
 
JSON_FIles-Py (2).pptx
sravanicharugundla1
 
Java Script Object Notation (JSON)
Adnan Sohail
 
Intro to JSON
Mark Daniel Dacer
 
JSON - (English)
Senior Dev
 
Json
soumya
 
JSON Data Parsing in Snowflake (By Faysal Shaarani)
Faysal Shaarani (MBA)
 
JSON.pptx
TilakaRt
 
What is JSON? Why use JSON? JSON Types? JSON Helpful Tools?
codeandyou forums
 
JSON beautifier (1).pdf
json beautifier
 
Web Fundamentals: JavaScript Objects Json and XML
kategeg121
 
An introduction to json
Naveenkumar5964
 
Ad

Recently uploaded (20)

PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Ad

All about XML, JSON and related topics..

  • 2.  JSON stands for JavaScript object notation. JSON has been derived from javascript, where javascript is a programming language. It was originally created to hold the structured data that could be used in javascript. JSON became so popular that it is used for data for all kinds of applications. It is the most popular way of sending the data for Web APIs.  Basic data types supported by JSON are: 1. Strings: Characters that are enclosed in single or double quotation marks. 2. Number: A number could be integer or decimal, positive or negative. 3. Booleans: The Boolean value could be either true or false without any quotation marks. 4. Null: Here, null means nothing without any quotation marks.
  • 3. WHAT IS XML?  XML stands for an extensible markup language. It is like HTML, where HTML stands for Hypertext Markup language. HTML is used for creating websites, whereas XML can be used for any kind of structured data.  XML has two ways of handling data, i.e., Tags and Attributes. The tags work as HTML. The start tags start with the <_> and end with the </_>. The start and end tags must match. The names must only be letters, numbers, and underscore, and the tag name must start with a letter only.
  • 4. SIMILARITIES BETWEEN THE JSON AND XML. 1. Self-describing: Both json and xml are self-describing as both xml data and json data are human-readable text. 2. Hierarchical: Both json and xml support hierarchical structure. Here hierarchical means that the values within values. 3. Data interchange format: JSON and XML can be used as data interchange formats by many different programming languages. 4. Parse: Both the formats can be easily parsed. 5. Retrieve: Both formats can be retrieved by using HTTP requests. The methods used for retrieving the data are GET, PUT, POST.
  • 5. DIFFERENCES BETWEEN THE JSON AND XML. JSON XML JSON stands for javascript object notation. XML stands for an extensible markup language. The extension of json file is .json. The extension of xml file is .xml. The internet media type is application/json. The internet media type is application/xml or text/xml. The type of format in JSON is data interchange. The type of format in XML is a markup language. It is extended from javascript. It is extended from SGML. It is open source means that we do not have to pay anything to use JSON. It is also open source. The object created in JSON has some type. XML data does not have any type.
  • 6. he data types supported by JSON are strings, numbers, Booleans, null, array. XML data is in a string format. It does not have any capacity to display the data. XML is a markup language, so it has the capacity to display the content. JSON has no tags. XML data is represented in tags, i.e., start tag and end tag. XML file is larger. If we want to represent the data in XML then it would create a larger file as compared to JSON. JSON is quicker to read and write. XML file takes time to read and write because the learning curve is higher. JSON can use arrays to represent the data. XML does not contain the concept of arrays. It can be parsed by a standard javascript function. It has to be parsed before use. XML data which is used to interchange the data, must be parsed with respective to their programming language to use that. It can be easily parsed and little bit code is required to parse the data. It is difficult to parse.
  • 7. File size is smaller as compared to XML. File size is larger. JSON is data-oriented. XML is document-oriented. It is less secure than XML. It is more secure than JSON.
  • 8.  The JSON syntax is a subset of the JavaScript syntax. JSON Syntax Rules 1. JSON syntax is derived from JavaScript object notation syntax: 2. Data is in name/value pairs 3. Data is separated by commas 4. Curly braces hold objects 5. Square brackets hold arrays
  • 9. JSON DATA - A NAME  JSON data is written as name/value pairs (aka key/value pairs).  A name/value pair consists of a field name (in double quotes), followed by a colon, followed by a value:  Example "name":"John"
  • 10. JSON VALUES  In JSON, values must be one of the following data types: 1. a string 2. a number 3. an object 4. an array 5. a boolean 6. null
  • 11.  In JavaScript values can be all of the above, plus any other valid JavaScript expression, including: 1. a function 2. a date 3. undefined  In JSON, string values must be written with double quotes:  JSON {"name":"John"}  In JavaScript, you can write string values with double or single quotes:  JavaScript {name:'John'}
  • 12. JSON OBJECT LITERALS  This is a JSON string: '{"name":"John", "age":30, "car":null}'  Inside the JSON string there is a JSON object literal: {"name":"John", "age":30, "car":null}  JSON object literals are surrounded by curly braces {}.  JSON object literals contains key/value pairs.  Keys and values are separated by a colon.  Keys must be strings, and values must be a valid JSON data type: 1. string 2. number 3. object 4. array 5. boolean 6. null  Each key/value pair is separated by a comma.
  • 13. JSON ARRAY LITERALS  This is a JSON string: '["Ford", "BMW", "Fiat"]'  Inside the JSON string there is a JSON array literal: ["Ford", "BMW", "Fiat"]  Arrays in JSON are almost the same as arrays in JavaScript.  In JSON, array values must be of type string, number, object, array, boolean or null.  In JavaScript, array values can be all of the above, plus any other valid JavaScript expression, including functions, dates, and undefined.