0% found this document useful (0 votes)
17 views25 pages

3.0 Introduction To XML

XML, or eXtensible Markup Language, is a markup language used for creating custom tags and facilitating data sharing applications. It is case-sensitive and organizes data in a hierarchical structure under a root element, without standalone elements. The document also provides examples of XML file structures for various systems, including blood donors, placements, and library management.

Uploaded by

Divya Mannava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views25 pages

3.0 Introduction To XML

XML, or eXtensible Markup Language, is a markup language used for creating custom tags and facilitating data sharing applications. It is case-sensitive and organizes data in a hierarchical structure under a root element, without standalone elements. The document also provides examples of XML file structures for various systems, including blood donors, placements, and library management.

Uploaded by

Divya Mannava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

What is XML?

 XML stands for eXtensible Markup Language which is a markup


language to create our own tags.
 XML is used in data sharing applications.

 XML is case-sensitive and meta markup language because it allows


you to create custom defined markup languages.
 XML is derived from SGML(Standard Generalized Markup
Langage).
 XML arranges the data in hierarchical database structure.

 XML doesn’t have standalone elements. The elements are arranged


in hierarchical manner inside a root element.
HOW TO WRITE AN XML FILE?
**NOTE: The structure of XML file varies w.r.t programmer’s logic.
EXAMPLE: BLOOD DONORS INFORMATION SYSTEM
Donor-Name Blood-Group District-Name Contact-No
Naveen O+ Prakasam 9948501801
Sarath O+ Guntur 9966445599
Ravi B+ Krishna 9948234567
Ashok B+ Krishna 8125865432
Nitin AB- Guntur 9160445678
Mukesh O- Prakasam 9543678765
Anil O- Nellore 9948765432
Siva AB+ Guntur 9966768765
Satish B- Guntur 9955009988
Siddartha A+ Chittor 9956786543
Vinay A- Nellore 9944146245
Vijay AB+ Krishna 9944123456
bdis
LOGIC 1:

Donor-name
Donor-name

Blood-group Blood-group

District-name District-name

Contact-no Contact-no

O+
Prakasam O+
Guntur

Naveen 9948501801 Sarath


9966445599
<?xml version=“1.0”?>
<bdis>
<donor-name> Naveen </donor-name>
<blood-group> O+ </blood-group>
<district-name> Prakasam </district-name>
<contact-no> 9948501801 </contact-no>

<donor-name> Sarath </donor-name>


<blood-group> O+ </blood-group>
<district-name> Guntur </district-name>
<contact-no> 9966445599 </contact-no>
<donor-name> Ravi </donor-name>
<blood-group> B+ </blood-group>
<district-name> Krishna </district-name>
<contact-no> 9948234567 </contact-no>

<donor-name> Ashok </donor-name>


<blood-group> B+ </blood-group>
<district-name> Krishna </district-name>
<contact-no> 8125865432 </contact-no>

</bdis>
bdis
LOGIC 2:

donor donor
Donor-name
Donor-name

Blood-group Blood-group

District-name District-name

Contact-no Contact-no

O+
Prakasam O+
Guntur

Naveen 9948501801 Sarath


9966445599
<?xml version=“1.0”?>
<bdis>
<donor>
<donor-name> Naveen </donor-name>
<blood-group> O+ </blood-group>
<district-name> Prakasam </district-name>
<contact-no> 9948501801 </contact-no>
</donor>
<donor>
<donor-name> Sarath </donor-name>
<blood-group> O+ </blood-group>
<district-name> Guntur </district-name>
<contact-no> 9966445599 </contact-no>
</donor>
<donor>
<donor-name> Ravi </donor-name>
<blood-group> B+ </blood-group>
<district-name> Krishna </district-name>
<contact-no> 9948234567 </contact-no>
</donor>
</bdis>
bdis
LOGIC 3:

donor1 donor2
Donor-name
Donor-name

Blood-group Blood-group

District-name District-name

Contact-no Contact-no

O+
Prakasam O+
Guntur

Naveen 9948501801 Sarath


9966445599
<?xml version=“1.0”?>
<bdis>
<donor1>
<donor-name> Naveen </donor-name>
<blood-group> O+ </blood-group>
<district-name> Prakasam </district-name>
<contact-no> 9948501801 </contact-no>
</donor1>
<donor2>
<donor-name> Sarath </donor-name>
<blood-group> O+ </blood-group>
<district-name> Guntur </district-name>
<contact-no> 9966445599 </contact-no>
</donor2>
<donor3>
<donor-name> Ravi </donor-name>
<blood-group> B+ </blood-group>
<district-name> Krishna </district-name>
<contact-no> 9948234567 </contact-no>
</donor3>
</bdis>
bdis
LOGIC 4:

donors

donor donor
Donor-name
Donor-name

Blood-group Blood-group

District-name District-name

O+ Contact-no Contact-no
Naveen Prakasam O+
Guntur
Sarath
9948501801 9966445599
<?xml version=“1.0”?>
<bdis>
<donors>
<donor>
<donor-name> Naveen </donor-name>
<blood-group> O+ </blood-group>
<district-name> Prakasam </district-name>
<contact-no> 9948501801 </contact-no>
</donor>
<donor>
<donor-name> Sarath </donor-name>
<blood-group> O+ </blood-group>
<district-name> Guntur </district-name>
<contact-no> 9966445599 </contact-no>
</donor>
<donor>
<donor-name> Ravi </donor-name>
<blood-group> B+ </blood-group>
<district-name> Krishna </district-name>
<contact-no> 9948234567 </contact-no>
</donor>
</donors>
</bdis>
EXAMPLE: PLACEMENT INFORMATION SYSTEM
Student-name Passed-out Placed-in Package
Naveen 2014 CapGemini 3.4
Sarath 2014 NTTData 4.5
Ravi 2015 TCS 2.5
Ashok 2014 CapGemini 3.4
Nitin 2017 NTTData 4.5
Mukesh 2016 TCS 2.5
Anil 2015 Robert Bosch 2.5
Siva 2014 CapGemini 3.4
Satish 2015 IBM 5.1
Siddartha 2016 Infosys 4.8
Vinay 2016 IBM 5.1
Vijay 2017 CapGemini 3.4
pis
LOGIC:

student student
Student-
Student-
name
name

Passed-out Passed-out

Placed-in Placed-in

Package Package

2014
CapGemini 2014
NTTData

Naveen 3.4 Sarath


4.5
<?xml version=“1.0”?>
<pis>
<student>
<student-name> Naveen </student-name>
<passed-out> 2014 </passed-out>
<placed-in> CapGemini </placed-in>
<package> 3.4 </package>
</student>
<student>
<student-name> Sarath </student-name>
<passed-out> 2014 </passed-out>
<placed-in> NTTData </placed-in>
<package> 4.5 </package>
</student>
<student>
<student-name> Ravi </student-name>
<passed-out> 2015 </passed-out>
<placed-in> TCS </placed-in>
<package> 2.5 </package>
</student>
</pis>
EXAMPLE: LIBRARY MANAGEMENT SYSTEM
Title Author ISBN Publisher Edition Price
C Balaguruswamy 1234 Pearson Second 25$
C++ Ashok 5678 Oxford Third 35$
Java Herbert Schildt 12345 Pearson Fourth 55$
PPL Robert Sabesta 517-76 Mc Graw Hill Seventh 70$
CG Donald Hearn 557-87 Pearson Seventh 60$
AI Peter Norvig 987-65 Mc Graw Hill Eleventh 54$
EDC Salivahanan 504-61 Oxford Twelfth 35$
C Y Kanetkar 403-87 BPB Twelfth 45$
UML Ivar Jacobson 609-41 Pearson Fifth 68$
DP Eric Gamma 938-19 Mc Graw Hill Third 75$
PHP Robert Sabesta 901-56 Cengage Second 56$
SE Pressman 401-32 Oxford First 56$
LOGIC:

Bookstore

book book book


title
title
author title
price author
isbn author
isbn
publisher isbn publisher
edition
edition
edition
price publisher
price
<?xml version=“1.0”?>
<bookstore>
<Book>
<Title> C </title>
<author> balaguruswamy </author>
<isbn> 1234 </isbn>
<publisher> pearson </publisher>
<edition> second </edition>
<price> $25 </price>
</Book>
<Book>
<Title> C++ </title>
<author> ashok </author>
<isbn> 5678 </isbn>
<publisher> oxford</publisher>
<edition> third </edition>
<price> $35 </price>
</Book>
<Book>
<Title> java </title>
<author> Herbert schildt </author>
<isbn> 12345 </isbn>
<publisher> pearson </publisher>
<edition> fourth </edition>
<price> $55 </price>
</Book>
</bookstore>
PROGRAM: OUTPUT:
<?xml version="1.0"?>
<countries>
<country>
<name>USA</name>
<capital>washington</capital>
</country>
<country>
<name>India</name>
<capital>Delhi</capital>
</country>
<country>
<name>Pakistan</name>
<capital>Islamabad</capital>
</country>
<country>
<name>Afghanistan</name>
<capital>Kabul</capital>
</country>
</countries>
WRITE AN XML FILE FOR HOSPITAL INFORMATION
MANAGEMENT SYSTEM.
LOGIC:
Hims

Inpatient Outpatient Doctors Supporting-


staff

Doa id name
Assign Ward-
specialist
name
- no
doctor id Designation
Room-
no
time
Assign-
name
Dov
care-taker Assign
-
Contact-no
doctor
State the goal of XML. [2][OCT/NOV-2019]
Discuss in detail about Namespaces in XML documents. [7][OCT/NOV-
2019]

Describe about XML Document Structure. [7][OCT/NOV-2019]

You might also like