5. JSON is a format/syntax
for storing and
exchanging data.
JSON is text, written with
JavaScript object
notation.
Breif Description
JSON is a lightweight
data-interchange format
JSON is "self-describing"
and easy to understand
JSON is language
independent *
6. Data is in name/value
pairs
Data is separated by
commas
Curly braces hold objects
Square brackets hold
arrays
Syntax
7. Data Types JSON support:
• string
• number
• object (JSON object)
• array
• boolean
Data-Type
• date
• time
• null
8. JSON objects are
surrounded by curly
braces { }.
JSON objects are written
in key/value pairs.
Keys must be strings, and
values must be a valid
JSON data type.
Keys and values are
separated by a colon.
DataTypes - Objects
Each key/value pair is
separated by a comma.
9. 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.
DataTypes - Arrays
10. When receiving data
from a web server, the
data is always a string.
Parse the data with
JSON.parse(), and the
data becomes a
JavaScript object.
Parser
14. XML is a markup
language much like
HTML
XML was designed to
store and transport data
HTML was designed to
display data elegently
Breif Description
XML Separates Data from
Presentation
XML is Often a
Complement to HTML
XML Separates Data from
HTML
15. XML documents are
formed as element trees
An XML tree starts at a
root element and
branches from the root
to child elements
All elements can have
sub elements (child
elements)
Syntax - Tree
16. XML may have conflict in
tags - They are defined
by developer
When using prefixes in
XML, a namespace for
the prefix must be
defined.
The namespace
declaration has the
following syntax.
xmlns:prefix="URI".
Syntax - Namespace
17. Primitive types XML
support:
• string
• decimal
• integer
• boolean
• date
• time
Data-Type
Supports many complex
data types including:
• charts
• graphs
• images
18. Before an XML document
can be accessed, it must
be loaded into an XML
DOM object.
All modern browsers
have a built-in XML
parser that can convert
text into an XML DOM
object.
Parser
20. XQuery is the language
for querying XML data
XQuery for XML is like
SQL for databases
XQuery is built on XPath
expressions
XQuery is supported by
all major databases
Data Access - XQuery
23. Features of JSON
⬥ Usage is Straight-Forward
⬥ No need to create a Mapping
⬥ Better Performance
⬥ Clean Data Format
⬥ No Dependency
24. Features of XML
⬥ Styled Processed Data can be Displayed by
XSLT
⬥ Meta-Data can also be defined (DTD)
⬥ Provide Namespace for Accurate Results
⬥ Used in Information Exchanges like b2b
transactions and b2c Transactions
⬥ Automated Tasks
⬥ InBuilt Error Handling
25. Easy to grasp
Creation and Manipulation
are Easy and Light-Weight
All major languages
frameworks support JSON
Transmission and
Serialization of the
Structured Data are done
using a Network Connection
Pros and Cons of JSON
JSON offers poor
Extensibility as no
Namespace Support
State Can not be
Transferred
26. XML exchanges Data
between different
platforms. So, it connects
different Systems and
Applications
XML Separates the Data
from HTML
XML Simplifies the Platform
Change Process
Secure Data Transfer
Pros and Cons of XML
XML requires processing
application
XML syntax can
sometimes be confusing
as it is similar to other
alternatives
No intrinsic/primitive
data type support
The XML syntax is
redundant
27. Scripting Language
Document-Oriented
Data is stored as Tree
Bulky and Slow
Stored data can be
Processed Natively
Comments are Valid
XML supports UTF-8 and
UTF-16 encodings
Which is used Where?
File Format based on
Javascript
Data-Oriented
Key-Value Pair
Fast and Reliable
No Processing is Avialable
Supports no Comments
JSON supports UTF as well as
ASCII encodings.
28. Saperate Tags are used for
each Item to use Array
XML can display with
Elegent Styling
JSON is supported by most
browsers
Supports Statefull Data
Exchange
Mostly used in SOAP APIs
Which is used Where?
Support Array as in
JavaScript
JSON has no display
capabilities
Cross-browser XML parsing
can be tricky
State can not be preserved
in JSON
Rest APIs mainly has JSON
response
29. Simple Object Access
Protocol
Data Transfer between
Programs built on different
Platforms and Programming
Languages
SOAP is it’self a Protocol
SOAP only works with XML
A Bird-Eye Overview
Representational State
Transfer
Deals with Files, Media
Components, or even Objects
on a Particular Hardware
Device
Use HTTP verbs of GET, POST,
PUT and DELETE for working
Plain Text, XML, HTML and
JSON. Rest APIs mainly has
JSON response
Editor's Notes
(XML Saparates Data from Presentation) XML does not carry any information about how to be displayed.
The same XML data can be used in many different presentation scenarios.
(XML is Complement toHTML) In many HTML applications, XML is used to store or transport data, while HTML is used to format and display the same data.
(XML Saperate Data from HTML) When displaying data in HTML, you should not have to edit the HTML file when the data changes.
With XML, the data can be stored in separate XML files.
With a few lines of JavaScript code, you can read an XML file and update the data content of any HTML page.
Extensible Style Language Transformer Document Type Defination
Rest Architectural Fearure
Client Server
Stateless
Cacheable
Layered System
Uniform Interface