Professional Documents
Culture Documents
XML and JSON
XML and JSON
XML
XML stands for eXtensible Markup Language.
• Markup is information added to a document that enhances its
meaning in certain ways, in that it identifies the parts and how they
relate to each other.
XML does not qualify to be a programming language as it does not perform any
computation or algorithms.
It is usually stored in a simple text file and is processed by special software that is
capable of interpreting XML.
Example
<?xml version = "1.0"?>
<Students>
<student id=‘1’>
<name>Guru</name>
<course>M.Sc</course>
<subject>Computer Science</subject>
</student>
<student id=‘2’>
<name>John</name>
<course>M.Sc</course>
<subject>Physics</subject>
</student>
.
.
.
</Students>
</xml>
Parsing a XML
• (DOM)Document Object Model: defines a standard for accessing and
manipulating documents.
• The XML DOM defines a standard way for accessing and manipulating XML
documents.
{
“Students": [
{ "id":"01", “name": “Guru", “course": “M.Sc", “subject": “Computer
Science" },
{ "id":“02", “name": “John", " course ": " M.Sc ", " subject ": “Physics" }]
}
Parsing JSON
XML JSON
1. XML is less simple than JSON. 1. JSON is simple to read and write.