SlideShare a Scribd company logo
XML(EXtensible Markup
Language)
4/28/2024 1
GAGAN THAKRAL(ABESEC)
XML
• XML stands for EXtensible Markup Language.
• XML is a markup language much like HTML.
• XML was designed to describe data.
• XML tags are not predefined. You must define
your own tags.
• XML uses a Document Type Definition (DTD)
or an XML Schema to describe the data.
• XML with a DTD or XML Schema is designed to
be self-descriptive.
4/28/2024 2
GAGAN THAKRAL(ABESEC)
XML
• Best description of XML is this: XML is a cross-
platform, software and hardware
independent tool for transmitting
information.
4/28/2024 3
GAGAN THAKRAL(ABESEC)
XML-Example
XML document : (file name: “xml_note.xml”)
<?xml version="1.0" encoding="ISO-
8859-1" ?>
<note>
<to>Aman</to>
<from>Raman</from>
<header>Reminder</header>
<body>Don't forget me this
weekend!</body>
</note>
4/28/2024 4
GAGAN THAKRAL(ABESEC)
More Example
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book category="COOKING">
<title lang="en">North Indian Food</title>
<author>Dr. Ram Parkash</author>
<year>2005</year>
<price>30.00</price>
</book>
<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
----------------
----------------
</bookstore>
4/28/2024 5
GAGAN THAKRAL(ABESEC)
The Main Differences
Between XML and HTML
– XML was designed to carry data.
– XML is not a replacement for HTML.
– XML and HTML were designed with different
goals:
• XML was designed to describe data and to focus on
what data is.
• HTML was designed to display data and to focus on
how data looks.
– HTML is about displaying information, while XML
is about describing information.
4/28/2024 6
GAGAN THAKRAL(ABESEC)
Advantages of Using XML
• Truly Portable Data
• Easily readable by human users
• Very expressive
• Very flexible and customizable
• Easy to use from programs (libs available)
• Easy to convert into other representations
• Many additional standards and tools
• Widely used and supported
4/28/2024 7
GAGAN THAKRAL(ABESEC)
XML Encoding
• XML documents can contain international
characters, like Norwegian æøå, or French
êèé.
• To avoid errors, you should specify the
encoding used, or save your XML files.
• Character encoding defines a unique binary
code for each different character used in a
document.
• In computer terms, character encoding are
also called character set, character map, code
set, and code page.
4/28/2024 8
GAGAN THAKRAL(ABESEC)
XML Encoding
1.ISO-8859-1
2. UTF-8
3. UTF-16
4/28/2024 9
GAGAN THAKRAL(ABESEC)
• The Unicode Standard has become a success
and is implemented in HTML, XML, Java,
JavaScript, E-mail, ASP, PHP, etc.
• The Unicode standard is also supported in
many operating systems and all modern
browsers.
• The Unicode Consortium cooperates with the
leading standards development organizations,
like ISO, W3C, and ECMA.
4/28/2024 10
GAGAN THAKRAL(ABESEC)
• UTF-8 uses 1 byte (8-bits) to represent basic
Latin characters, and two, three, or four bytes
for the rest.
• UTF-8 = The Web Standard
• UTF-8 is the standard character encoding on
the web.
• UTF-8 is the default character encoding for
HTML5, CSS, JavaScript, PHP, SQL, and XML.
• UTF-16 uses 2 bytes (16 bits) for most
characters, and four bytes for the rest.
4/28/2024 11
GAGAN THAKRAL(ABESEC)
A Simple XML Document
<article>
<author>Gerhard Weikum</author>
<title>The Web in Ten Years</title>
<text>
<abstract>In order to evolve...</abstract>
<section number=“1” title=“Introduction”>
The <index>Web</index> provides the
universal...
</section>
</text>
</article>
4/28/2024 12
GAGAN THAKRAL(ABESEC)
A Simple XML Document
<article>
<author>Gerhard Weikum</author>
<title>The Web in Ten Years</title>
<text>
<abstract>In order to evolve...</abstract>
<section number=“1” title=“Introduction”>
The <index>Web</index> provides the
universal...
</section>
</text>
</article>
Freely definable
tags
4/28/2024 13
GAGAN THAKRAL(ABESEC)
Elements in XML Documents
• (Freely definable) tags: article, title, author
– with start tag: <article> etc.
– and end tag: </article> etc.
• Elements: <article> ... </article>
• Elements have a name (article) and a content (...)
• Elements may be nested.
• Elements may be empty: <this_is_empty/>
• Each XML document has exactly one root element and forms
a tree.
• Elements with a common parent are ordered.
4/28/2024 14
GAGAN THAKRAL(ABESEC)
Elements vs. Attributes
Elements may have attributes (in the start tag) that have a name and
a value, e.g. <section number=“1“>.
What is the difference between elements and attributes?
• Only one attribute with a given name per element (but an arbitrary
number of subelements)
• Attributes have no structure, simply strings (while elements can have
subelements)
As a rule of thumb:
• Content into elements
• Metadata into attributes
Example:
<person born=“1912-06-23“ died=“1954-06-07“>
Abc</person> proved that…
4/28/2024 15
GAGAN THAKRAL(ABESEC)
XML Documents as Ordered Trees
article
author title text
section
abstract
The index
We
b
provides
…
title=“…“
number=“1“
In order
…
The Web
in 10
years
4/28/2024 16
GAGAN THAKRAL(ABESEC)
Well-Formed XML Documents
A well-formed document must adher to, among others, the
following rules:
• Every start tag has a matching end tag.
• Elements may nest, but must not overlap.
• There must be exactly one root element.
• Attribute values must be quoted.
• An element may not have two attributes with the same
name.
• Comments and processing instructions may not appear
inside tags.
4/28/2024 17
GAGAN THAKRAL(ABESEC)
Well-Formed XML Documents
A well-formed document must adher to, among others, the
following rules:
• Every start tag has a matching end tag.
• Elements may nest, but must not overlap.
• There must be exactly one root element.
• Attribute values must be quoted.
• An element may not have two attributes with the same
name.
• Comments and processing instructions may not appear
inside tags.
Only well-formed documents can
be processed by XML parsers.
4/28/2024 18
GAGAN THAKRAL(ABESEC)
XML is not…
• A replacement for HTML
(but HTML can be generated from XML)
• A presentation format
(but XML can be converted into one)
• A programming language
(but it can be used with almost any language)
• A network transfer protocol
(but XML may be transferred over a network)
• A database
(but XML may be stored into a database)
4/28/2024 19
GAGAN THAKRAL(ABESEC)
Conversion of XML into Tree
<?xml version = “1.0” ?>
<address>
<name>
<first>Shiva</first>
<last>Singh</last>
</name>
<email>shivasingh@gmail.com</email>
<phone>9999999999</phone>
<birthday>
<year>1991</year>
<month>03</month>
<day>11</day>
</birthday>
</address>
4/28/2024 20
GAGAN THAKRAL(ABESEC)
• A well-formed XML document has a tree
structure and obeys all the XML rules.
• A particular application may add more rules in
either a DTD (document type definition) or in
a schema.
• Many specialized DTDs and schemas have
been created to describe particular areas.
4/28/2024 21
GAGAN THAKRAL(ABESEC)
Document Type Definitions
• A DTD describes the tree structure of a
document and something about its data.
• There are two data types, PCDATA and CDATA.
– PCDATA is parsed character data.
– CDATA is character data, not usually parsed.
• A DTD determines how many times a node
may appear, and how child nodes are ordered.
4/28/2024 22
GAGAN THAKRAL(ABESEC)
DTD for address Example
<!ELEMENT address (name, email, phone, birthday)>
<!ELEMENT name (first, last)>
<!ELEMENT first (#PCDATA)>
<!ELEMENT last (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT birthday (year, month, day)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT month (#PCDATA)>
<!ELEMENT day (#PCDATA)>
4/28/2024 23
GAGAN THAKRAL(ABESEC)
Schemas
• Schemas are themselves XML documents.
• They were standardized after DTDs and provide more
information about the document.
• They have a number of data types including string,
decimal, integer, boolean, date, and time.
• They divide elements into simple and complex types.
• They also determine the tree structure and how
many children a node may have.
4/28/2024 24
GAGAN THAKRAL(ABESEC)
Schema for address Example
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:element name="address">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="email" type="xs:string"/>
<xs:element name="phone" type="xs:string"/>
<xs:element name="birthday" type="xs:date"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
4/28/2024 25
GAGAN THAKRAL(ABESEC)
XML Parsers
• An XML parser is a software library or package
that provides interfaces for client applications
to work with an XML document.
• The XML Parser is designed to read the XML
and create a way for programs to use XML.
• XML parser validates the document and check
that the document is well formatted.
4/28/2024 GAGAN THAKRAL(ABESEC) 26
Let's understand the working of
XML parser by the figure given
below:
4/28/2024 GAGAN THAKRAL(ABESEC) 27
Types of XML Parsers
• These are the two main types of XML Parsers:
1. DOM
2. SAX
4/28/2024 GAGAN THAKRAL(ABESEC) 28
DOM (Document Object Model)
• A DOM document is an object which contains
all the information of an XML document. It is
composed like a tree structure.
• The DOM Parser implements a DOM API. This
API is very simple to use.
4/28/2024 GAGAN THAKRAL(ABESEC) 29
Features of DOM Parser
• A DOM Parser creates an internal structure in
memory which is a DOM document object and
the client applications get information of the
original XML document by invoking methods
on this document object.
• DOM Parser has a tree based structure.
4/28/2024 GAGAN THAKRAL(ABESEC) 30
Advantages
1) It supports both read and write operations
and the API is very simple to use.
2) It is preferred when random access to widely
separated parts of a document is required.
4/28/2024 GAGAN THAKRAL(ABESEC) 31
Disadvantages
• It is memory inefficient. (consumes more
memory because the whole XML document
needs to loaded into memory).
• It is comparatively slower than other parsers.
4/28/2024 GAGAN THAKRAL(ABESEC) 32
SAX (Simple API for XML)
• A SAX Parser implements SAX API. This API is
an event based API and less intuitive.
4/28/2024 GAGAN THAKRAL(ABESEC) 33
Features of SAX Parser
• It does not create any internal structure.
• Clients does not know what methods to call,
they just overrides the methods of the API and
place his own code inside method.
• It is an event based parser, it works like an
event handler in Java.
4/28/2024 GAGAN THAKRAL(ABESEC) 34
Advantages
• It is simple and memory efficient.
• It is very fast and works for huge documents.
4/28/2024 GAGAN THAKRAL(ABESEC) 35
Disadvantages
• It is event-based so its API is less intuitive.
• Clients never know the full information
because the data is broken into pieces.
4/28/2024 GAGAN THAKRAL(ABESEC) 36

More Related Content

Similar to XML(EXtensible Markup Language). XML(EXtensible Markup Language).pptppt

Xml
XmlXml
Web services Overview in depth
Web services Overview in depthWeb services Overview in depth
Web services Overview in depth
AbdulImrankhan7
 
XML for beginners
XML for beginnersXML for beginners
XML for beginners
safysidhu
 
Data interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTDData interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTD
AnushaMahmood
 
Xml
XmlXml
WT UNIT-2 XML.pdf
WT UNIT-2 XML.pdfWT UNIT-2 XML.pdf
WT UNIT-2 XML.pdf
Ranjeet Reddy
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
Dr.Saranya K.G
 
XML
XMLXML
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
Swati Parmar
 
Unit_2_Xml.ppt
Unit_2_Xml.pptUnit_2_Xml.ppt
Unit_2_Xml.ppt
Sushil Bhardwaj
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
Maung Nyunt
 
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5   XMLM.FLORENCE DAYANA WEB DESIGN -Unit 5   XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
Dr.Florence Dayana
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
vamsi krishna
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
vamsitricks
 
Xmll
XmllXmll
Xml Session No 1
Xml Session No 1Xml Session No 1
Xml Session No 1
Saif Ullah Dar
 
Xml
XmlXml
8023.ppt
8023.ppt8023.ppt
8023.ppt
PoojaTripathi92
 
XML
XMLXML
Unit 2.3
Unit 2.3Unit 2.3

Similar to XML(EXtensible Markup Language). XML(EXtensible Markup Language).pptppt (20)

Xml
XmlXml
Xml
 
Web services Overview in depth
Web services Overview in depthWeb services Overview in depth
Web services Overview in depth
 
XML for beginners
XML for beginnersXML for beginners
XML for beginners
 
Data interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTDData interchange integration, HTML XML Biological XML DTD
Data interchange integration, HTML XML Biological XML DTD
 
Xml
XmlXml
Xml
 
WT UNIT-2 XML.pdf
WT UNIT-2 XML.pdfWT UNIT-2 XML.pdf
WT UNIT-2 XML.pdf
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
XML
XMLXML
XML
 
Xml and DTD's
Xml and DTD'sXml and DTD's
Xml and DTD's
 
Unit_2_Xml.ppt
Unit_2_Xml.pptUnit_2_Xml.ppt
Unit_2_Xml.ppt
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5   XMLM.FLORENCE DAYANA WEB DESIGN -Unit 5   XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Xmll
XmllXmll
Xmll
 
Xml Session No 1
Xml Session No 1Xml Session No 1
Xml Session No 1
 
Xml
XmlXml
Xml
 
8023.ppt
8023.ppt8023.ppt
8023.ppt
 
XML
XMLXML
XML
 
Unit 2.3
Unit 2.3Unit 2.3
Unit 2.3
 

Recently uploaded

How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....
How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....
How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....
Lacey Max
 
Business storytelling: key ingredients to a story
Business storytelling: key ingredients to a storyBusiness storytelling: key ingredients to a story
Business storytelling: key ingredients to a story
Alexandra Fulford
 
CULR Spring 2024 Journal.pdf testing for duke
CULR Spring 2024 Journal.pdf testing for dukeCULR Spring 2024 Journal.pdf testing for duke
CULR Spring 2024 Journal.pdf testing for duke
ZevinAttisha
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results
 
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
taqyea
 
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdfThe Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
thesiliconleaders
 
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
concepsionchomo153
 
The latest Heat Pump Manual from Newentide
The latest Heat Pump Manual from NewentideThe latest Heat Pump Manual from Newentide
The latest Heat Pump Manual from Newentide
JoeYangGreatMachiner
 
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Niswey
 
The Genesis of BriansClub.cm Famous Dark WEb Platform
The Genesis of BriansClub.cm Famous Dark WEb PlatformThe Genesis of BriansClub.cm Famous Dark WEb Platform
The Genesis of BriansClub.cm Famous Dark WEb Platform
SabaaSudozai
 
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...
my Pandit
 
list of states and organizations .pdf
list of  states  and  organizations .pdflist of  states  and  organizations .pdf
list of states and organizations .pdf
Rbc Rbcua
 
欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】
欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】
欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】
valvereliz227
 
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta MatkaDpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta Matka
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Best Competitive Marble Pricing in Dubai - ☎ 9928909666
Best Competitive Marble Pricing in Dubai - ☎ 9928909666Best Competitive Marble Pricing in Dubai - ☎ 9928909666
Best Competitive Marble Pricing in Dubai - ☎ 9928909666
Stone Art Hub
 
Registered-Establishment-List-in-Uttarakhand-pdf.pdf
Registered-Establishment-List-in-Uttarakhand-pdf.pdfRegistered-Establishment-List-in-Uttarakhand-pdf.pdf
Registered-Establishment-List-in-Uttarakhand-pdf.pdf
dazzjoker
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
➒➌➎➏➑➐➋➑➐➐Dpboss Matka Guessing Satta Matka Kalyan Chart Indian Matka
 
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
IPLTech Electric
 
Prescriptive analytics BA4206 Anna University PPT
Prescriptive analytics BA4206 Anna University PPTPrescriptive analytics BA4206 Anna University PPT
Prescriptive analytics BA4206 Anna University PPT
Freelance
 
PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...
PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...
PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...
Ksquare Energy Pvt. Ltd.
 

Recently uploaded (20)

How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....
How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....
How are Lilac French Bulldogs Beauty Charming the World and Capturing Hearts....
 
Business storytelling: key ingredients to a story
Business storytelling: key ingredients to a storyBusiness storytelling: key ingredients to a story
Business storytelling: key ingredients to a story
 
CULR Spring 2024 Journal.pdf testing for duke
CULR Spring 2024 Journal.pdf testing for dukeCULR Spring 2024 Journal.pdf testing for duke
CULR Spring 2024 Journal.pdf testing for duke
 
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan ChartSatta Matka Dpboss Kalyan Matka Results Kalyan Chart
Satta Matka Dpboss Kalyan Matka Results Kalyan Chart
 
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
一比一原版(QMUE毕业证书)英国爱丁堡玛格丽特女王大学毕业证文凭如何办理
 
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdfThe Most Inspiring Entrepreneurs to Follow in 2024.pdf
The Most Inspiring Entrepreneurs to Follow in 2024.pdf
 
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
欧洲杯投注-欧洲杯投注外围盘口-欧洲杯投注盘口app|【​网址​🎉ac22.net🎉​】
 
The latest Heat Pump Manual from Newentide
The latest Heat Pump Manual from NewentideThe latest Heat Pump Manual from Newentide
The latest Heat Pump Manual from Newentide
 
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
Unlocking WhatsApp Marketing with HubSpot: Integrating Messaging into Your Ma...
 
The Genesis of BriansClub.cm Famous Dark WEb Platform
The Genesis of BriansClub.cm Famous Dark WEb PlatformThe Genesis of BriansClub.cm Famous Dark WEb Platform
The Genesis of BriansClub.cm Famous Dark WEb Platform
 
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...
Unveiling the Dynamic Personalities, Key Dates, and Horoscope Insights: Gemin...
 
list of states and organizations .pdf
list of  states  and  organizations .pdflist of  states  and  organizations .pdf
list of states and organizations .pdf
 
欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】
欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】
欧洲杯赌球-欧洲杯赌球买球官方官网-欧洲杯赌球比赛投注官网|【​网址​🎉ac55.net🎉​】
 
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta MatkaDpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta Matka
Dpboss Matka Guessing Satta Matta Matka Kalyan Chart Satta Matka
 
Best Competitive Marble Pricing in Dubai - ☎ 9928909666
Best Competitive Marble Pricing in Dubai - ☎ 9928909666Best Competitive Marble Pricing in Dubai - ☎ 9928909666
Best Competitive Marble Pricing in Dubai - ☎ 9928909666
 
Registered-Establishment-List-in-Uttarakhand-pdf.pdf
Registered-Establishment-List-in-Uttarakhand-pdf.pdfRegistered-Establishment-List-in-Uttarakhand-pdf.pdf
Registered-Establishment-List-in-Uttarakhand-pdf.pdf
 
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
Dpboss Matka Guessing Satta Matta Matka Kalyan panel Chart Indian Matka Dpbos...
 
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
Sustainable Logistics for Cost Reduction_ IPLTech Electric's Eco-Friendly Tra...
 
Prescriptive analytics BA4206 Anna University PPT
Prescriptive analytics BA4206 Anna University PPTPrescriptive analytics BA4206 Anna University PPT
Prescriptive analytics BA4206 Anna University PPT
 
PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...
PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...
PM Surya Ghar Muft Bijli Yojana: Online Application, Eligibility, Subsidies &...
 

XML(EXtensible Markup Language). XML(EXtensible Markup Language).pptppt

  • 2. XML • XML stands for EXtensible Markup Language. • XML is a markup language much like HTML. • XML was designed to describe data. • XML tags are not predefined. You must define your own tags. • XML uses a Document Type Definition (DTD) or an XML Schema to describe the data. • XML with a DTD or XML Schema is designed to be self-descriptive. 4/28/2024 2 GAGAN THAKRAL(ABESEC)
  • 3. XML • Best description of XML is this: XML is a cross- platform, software and hardware independent tool for transmitting information. 4/28/2024 3 GAGAN THAKRAL(ABESEC)
  • 4. XML-Example XML document : (file name: “xml_note.xml”) <?xml version="1.0" encoding="ISO- 8859-1" ?> <note> <to>Aman</to> <from>Raman</from> <header>Reminder</header> <body>Don't forget me this weekend!</body> </note> 4/28/2024 4 GAGAN THAKRAL(ABESEC)
  • 5. More Example <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="COOKING"> <title lang="en">North Indian Food</title> <author>Dr. Ram Parkash</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> ---------------- ---------------- </bookstore> 4/28/2024 5 GAGAN THAKRAL(ABESEC)
  • 6. The Main Differences Between XML and HTML – XML was designed to carry data. – XML is not a replacement for HTML. – XML and HTML were designed with different goals: • XML was designed to describe data and to focus on what data is. • HTML was designed to display data and to focus on how data looks. – HTML is about displaying information, while XML is about describing information. 4/28/2024 6 GAGAN THAKRAL(ABESEC)
  • 7. Advantages of Using XML • Truly Portable Data • Easily readable by human users • Very expressive • Very flexible and customizable • Easy to use from programs (libs available) • Easy to convert into other representations • Many additional standards and tools • Widely used and supported 4/28/2024 7 GAGAN THAKRAL(ABESEC)
  • 8. XML Encoding • XML documents can contain international characters, like Norwegian æøå, or French êèé. • To avoid errors, you should specify the encoding used, or save your XML files. • Character encoding defines a unique binary code for each different character used in a document. • In computer terms, character encoding are also called character set, character map, code set, and code page. 4/28/2024 8 GAGAN THAKRAL(ABESEC)
  • 9. XML Encoding 1.ISO-8859-1 2. UTF-8 3. UTF-16 4/28/2024 9 GAGAN THAKRAL(ABESEC)
  • 10. • The Unicode Standard has become a success and is implemented in HTML, XML, Java, JavaScript, E-mail, ASP, PHP, etc. • The Unicode standard is also supported in many operating systems and all modern browsers. • The Unicode Consortium cooperates with the leading standards development organizations, like ISO, W3C, and ECMA. 4/28/2024 10 GAGAN THAKRAL(ABESEC)
  • 11. • UTF-8 uses 1 byte (8-bits) to represent basic Latin characters, and two, three, or four bytes for the rest. • UTF-8 = The Web Standard • UTF-8 is the standard character encoding on the web. • UTF-8 is the default character encoding for HTML5, CSS, JavaScript, PHP, SQL, and XML. • UTF-16 uses 2 bytes (16 bits) for most characters, and four bytes for the rest. 4/28/2024 11 GAGAN THAKRAL(ABESEC)
  • 12. A Simple XML Document <article> <author>Gerhard Weikum</author> <title>The Web in Ten Years</title> <text> <abstract>In order to evolve...</abstract> <section number=“1” title=“Introduction”> The <index>Web</index> provides the universal... </section> </text> </article> 4/28/2024 12 GAGAN THAKRAL(ABESEC)
  • 13. A Simple XML Document <article> <author>Gerhard Weikum</author> <title>The Web in Ten Years</title> <text> <abstract>In order to evolve...</abstract> <section number=“1” title=“Introduction”> The <index>Web</index> provides the universal... </section> </text> </article> Freely definable tags 4/28/2024 13 GAGAN THAKRAL(ABESEC)
  • 14. Elements in XML Documents • (Freely definable) tags: article, title, author – with start tag: <article> etc. – and end tag: </article> etc. • Elements: <article> ... </article> • Elements have a name (article) and a content (...) • Elements may be nested. • Elements may be empty: <this_is_empty/> • Each XML document has exactly one root element and forms a tree. • Elements with a common parent are ordered. 4/28/2024 14 GAGAN THAKRAL(ABESEC)
  • 15. Elements vs. Attributes Elements may have attributes (in the start tag) that have a name and a value, e.g. <section number=“1“>. What is the difference between elements and attributes? • Only one attribute with a given name per element (but an arbitrary number of subelements) • Attributes have no structure, simply strings (while elements can have subelements) As a rule of thumb: • Content into elements • Metadata into attributes Example: <person born=“1912-06-23“ died=“1954-06-07“> Abc</person> proved that… 4/28/2024 15 GAGAN THAKRAL(ABESEC)
  • 16. XML Documents as Ordered Trees article author title text section abstract The index We b provides … title=“…“ number=“1“ In order … The Web in 10 years 4/28/2024 16 GAGAN THAKRAL(ABESEC)
  • 17. Well-Formed XML Documents A well-formed document must adher to, among others, the following rules: • Every start tag has a matching end tag. • Elements may nest, but must not overlap. • There must be exactly one root element. • Attribute values must be quoted. • An element may not have two attributes with the same name. • Comments and processing instructions may not appear inside tags. 4/28/2024 17 GAGAN THAKRAL(ABESEC)
  • 18. Well-Formed XML Documents A well-formed document must adher to, among others, the following rules: • Every start tag has a matching end tag. • Elements may nest, but must not overlap. • There must be exactly one root element. • Attribute values must be quoted. • An element may not have two attributes with the same name. • Comments and processing instructions may not appear inside tags. Only well-formed documents can be processed by XML parsers. 4/28/2024 18 GAGAN THAKRAL(ABESEC)
  • 19. XML is not… • A replacement for HTML (but HTML can be generated from XML) • A presentation format (but XML can be converted into one) • A programming language (but it can be used with almost any language) • A network transfer protocol (but XML may be transferred over a network) • A database (but XML may be stored into a database) 4/28/2024 19 GAGAN THAKRAL(ABESEC)
  • 20. Conversion of XML into Tree <?xml version = “1.0” ?> <address> <name> <first>Shiva</first> <last>Singh</last> </name> <email>shivasingh@gmail.com</email> <phone>9999999999</phone> <birthday> <year>1991</year> <month>03</month> <day>11</day> </birthday> </address> 4/28/2024 20 GAGAN THAKRAL(ABESEC)
  • 21. • A well-formed XML document has a tree structure and obeys all the XML rules. • A particular application may add more rules in either a DTD (document type definition) or in a schema. • Many specialized DTDs and schemas have been created to describe particular areas. 4/28/2024 21 GAGAN THAKRAL(ABESEC)
  • 22. Document Type Definitions • A DTD describes the tree structure of a document and something about its data. • There are two data types, PCDATA and CDATA. – PCDATA is parsed character data. – CDATA is character data, not usually parsed. • A DTD determines how many times a node may appear, and how child nodes are ordered. 4/28/2024 22 GAGAN THAKRAL(ABESEC)
  • 23. DTD for address Example <!ELEMENT address (name, email, phone, birthday)> <!ELEMENT name (first, last)> <!ELEMENT first (#PCDATA)> <!ELEMENT last (#PCDATA)> <!ELEMENT email (#PCDATA)> <!ELEMENT phone (#PCDATA)> <!ELEMENT birthday (year, month, day)> <!ELEMENT year (#PCDATA)> <!ELEMENT month (#PCDATA)> <!ELEMENT day (#PCDATA)> 4/28/2024 23 GAGAN THAKRAL(ABESEC)
  • 24. Schemas • Schemas are themselves XML documents. • They were standardized after DTDs and provide more information about the document. • They have a number of data types including string, decimal, integer, boolean, date, and time. • They divide elements into simple and complex types. • They also determine the tree structure and how many children a node may have. 4/28/2024 24 GAGAN THAKRAL(ABESEC)
  • 25. Schema for address Example <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:element name="address"> <xs:complexType> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="email" type="xs:string"/> <xs:element name="phone" type="xs:string"/> <xs:element name="birthday" type="xs:date"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> 4/28/2024 25 GAGAN THAKRAL(ABESEC)
  • 26. XML Parsers • An XML parser is a software library or package that provides interfaces for client applications to work with an XML document. • The XML Parser is designed to read the XML and create a way for programs to use XML. • XML parser validates the document and check that the document is well formatted. 4/28/2024 GAGAN THAKRAL(ABESEC) 26
  • 27. Let's understand the working of XML parser by the figure given below: 4/28/2024 GAGAN THAKRAL(ABESEC) 27
  • 28. Types of XML Parsers • These are the two main types of XML Parsers: 1. DOM 2. SAX 4/28/2024 GAGAN THAKRAL(ABESEC) 28
  • 29. DOM (Document Object Model) • A DOM document is an object which contains all the information of an XML document. It is composed like a tree structure. • The DOM Parser implements a DOM API. This API is very simple to use. 4/28/2024 GAGAN THAKRAL(ABESEC) 29
  • 30. Features of DOM Parser • A DOM Parser creates an internal structure in memory which is a DOM document object and the client applications get information of the original XML document by invoking methods on this document object. • DOM Parser has a tree based structure. 4/28/2024 GAGAN THAKRAL(ABESEC) 30
  • 31. Advantages 1) It supports both read and write operations and the API is very simple to use. 2) It is preferred when random access to widely separated parts of a document is required. 4/28/2024 GAGAN THAKRAL(ABESEC) 31
  • 32. Disadvantages • It is memory inefficient. (consumes more memory because the whole XML document needs to loaded into memory). • It is comparatively slower than other parsers. 4/28/2024 GAGAN THAKRAL(ABESEC) 32
  • 33. SAX (Simple API for XML) • A SAX Parser implements SAX API. This API is an event based API and less intuitive. 4/28/2024 GAGAN THAKRAL(ABESEC) 33
  • 34. Features of SAX Parser • It does not create any internal structure. • Clients does not know what methods to call, they just overrides the methods of the API and place his own code inside method. • It is an event based parser, it works like an event handler in Java. 4/28/2024 GAGAN THAKRAL(ABESEC) 34
  • 35. Advantages • It is simple and memory efficient. • It is very fast and works for huge documents. 4/28/2024 GAGAN THAKRAL(ABESEC) 35
  • 36. Disadvantages • It is event-based so its API is less intuitive. • Clients never know the full information because the data is broken into pieces. 4/28/2024 GAGAN THAKRAL(ABESEC) 36