Jimma University
Jimma Institute of Technology (JIT)
Faculty of Computing & Informatics
Automation of library and Information
systems
(INSC 3624)
Instructor Solomon A.
Email:- [email protected]
4/24/2025 1
Chapter 5
XML
Fall 2025
4/24/2025 2
Revision of previous class
• Development phases of Automation System
• Integrated Library Management system
4/24/2025 3
General Overview
• XML
4/24/2025 4
XML
• It stands for Extensible Markup Language.
• It is a general purpose markup language.
• It is classified as extensible language
because it allows its users to define their own
elements.
• Its primary purpose is to facilitate the sharing of
structured data across different information
systems, particularly via internet.
• It is used both to encode documents & serialize
data.
4/24/2025 5
Contd.
• Data serialization involves converting data
structures into a format that can be easily
stored or transmitted.
• XML excels in this area by providing a
standardized way to serialize data.
4/24/2025 6
Contd.
• XML started as a simplified subset of the
Standard Generalized Markup Language (SGML)
& is designed to be relatively human-
legible/readable.
• In February 1998, XML became W3C
recommendation.
• XML is much like HTML.
• It was designed to Carry data, not to display
data.
4/24/2025 7
Contd.
• XML tags are not predefined.
Users must define their own tags.
• XML is designed to be self-descriptive.
• It is fee-free open standard.
• It is a software & hardware independent
tool for carrying information.
4/24/2025 8
XML & HTML
• XML is not a replacement for HTML.
• They were designed for different purposes.
• XML was designed to transport and store data,
with focus on What data is.
• HTML was designed to display data , with focus
on How data looks.
• HTML is about displaying information, while XML
is about carrying information.
4/24/2025 9
Example of XML document
• Note from Abebe to Tolossa
<note>
<to> Tolossa </to>
<from> Abebe </from>
<heading> Reminder </heading>
<body> Send materials of Automation </body>
</note>
4/24/2025 10
XML file observed from browser
<?xml version= “1.0” encoding= “ISO – 8859- 1” ?>
-<note>
<to> Tolossa <to>
<from> Abebe <from>
<heading> Reminder <heading>
<body> Send materials of Automation <body>
<note>
4/24/2025 11
Contd.
• The XML document will be displayed with color-
coded root & child elements.
• A plus (+) or Minus (-) to the left of the
elements can be clicked to expand or collapse
the element structure.
• Example:
-<note> or
+<note>
4/24/2025 12
Meaning of XML document
• The first line is the XML declaration.
It defines the XML version (1.0) & the encoding
used (ISO – 8859 - 1)
<?xml version= “1.0” encoding= “ISO – 8859- 1” ?>
• The second line describes the root element of
the document (like saying “this document is a
note”)
<note>
4/24/2025 13
Contd.
• The next four (4) lines describe 4 child
elements of the root.
<to>
<from>
<heading>
<body>
• The last line defines the end of the root
element.
<note>
4/24/2025 14
Why does XML documents
appeared like this?
• XML documents do not carry information about
how to display the data.
• Since XML tags are “invented by the author
of the document,” browsers do not know if a
ag like <table> describes HTML table or
dining table.
• Without any information about how to display
the data, most browsers just display the XML
document as it is.
• So, you don’t have to expect XML files to be
displayed as HTML pages.
4/24/2025 15
Parent-child relationship
• XML documents form a tree structure.
• These documents must contain a root element.
• This element is “the parent” of all other
elements.
• The XML tree structure starts at the root &
branches to the lowest level of the tree.
• All elements can have sub elements (child
elements).
4/24/2025 16
Parent-child relationship
<root>
<child>
<subchild> ………. </subchild>
</child>
</root>
4/24/2025 17
Contd.
• The terms parent, child & sibling are used to
describe the relationship between elements.
• Parent elements have children.
• Children on the same level are called Siblings
(brothers or sisters)
• All elements of XML can have text content &
attributes (just like in HTML).
4/24/2025 18
4/24/2025 19
XML is self described
• The tags like <to> or <from> are not defined
in any XML standard.
• These tags are invented by the author of the
XML document.
• That is because the XML language has no
predefined tags.
• However, the tags in HTML are predefined.
• HTML documents can only use tags defined in
the HTML standard.
Example, <p> , <h1> , <h2>, …
4/24/2025 20
4/24/2025 21
How to use XML
• XML separates data from HTML.
• If you need to display dynamic data in your
HTML document, it will take a lot of work to edit
the HTML each time the data changes.
• With XML, data can be stored in separate XML
files.
• With a few lines of JavaScript, you can read an
external XML file and update the data content of
your HTML.
4/24/2025 22
XML simplifies platform
changes
• Upgrading to new systems (hardware or
software platforms) is always very time
consuming.
Large amounts of data must be converted &
incompatible data is often lost.
• XML data is stored in text format.
• This makes it easier to expand or upgrade to
new operating systems, new applications or new
browsers without losing data.
4/24/2025 23
XML makes our data more
available
• Since XML is independent of hardware, software
& application, it can make our data more available
and useful.
• Different applications can access our data, not
only in HTML pages, but also from XML data
sources.
• With XML, our data can be available to all kinds of
“reading machines.”
Example, handheld computers, voice machines
• This file ca be available for blind people, or people
with other disabilities.
4/24/2025 24
XML is used to create new
internet languages
• Since XML is independent of hardware & software,
a lot of new internet languages are created with
XML.
• Examples:
XHTML… It is the latest version of HTML.
WSDL…. It is used for describing available web
services.
WAP & WML ….. Thy are used as markup
languages for handheld devices.
RSS…. It is a language used for news feeds.
4/24/2025 25
Contd.
RDF & OWL ….. They are used for describing
resources & ontology.
SMIL….. It is used to describe multimedia for
the web.
4/24/2025 26
XML tags are case sensitive
• XML elements are defined using XML tags.
• With XML, the tag <Letter> is different from
the tag <letter>.
• Opening & closing tags must be written.
Example:
<message> this is not true </message>
• Opening & closing tags are often known as
start & end tags.
4/24/2025 27
XML elements must be properly
nested
• In XML, all elements must be properly nested
within each other.
Example:
<b> <i> This text is bold & italic </i> </b>
• Since <i> element is opened inside the <b>
element, it must be closed inside <b> element.
4/24/2025 28
XML attributes must be quoted
• XML elements can have attributes in
name/value pairs just like in HTML.
• In XML, the attribute values must always be
quoted.
Incorrect XML document
<note date = 16/4/2025>
<to> me </to>
<from> you </from>
</note>
4/24/2025 29
Contd.
Correct XML document
<note date = “16/4/2025”>
<to> me </to>
<from> you </from>
</note>
4/24/2025 30
Advantages of XML
• It is text-based.
• It supports Unicode, allowing almost any
information in any written human language.
• It can represent common computer science data
structures: records, lists & trees.
• It is heavily used as a format for document storage
& processing both online & offline.
• It is based on international standard.
• The hierarchical structure is suitable for most (but not
all) types of documents.
• It is platform-independent, thus relatively immune to
changes in technology.
4/24/2025 31
Disadvantages of XML
• XML syntax is redundant or large relative to
binary representations of similar data.
• The redundancy may affect application efficiency
through higher storage, transmission &
processing costs.
• Linking between XML documents requires the use
of XLink, which is complex compared to
Hyperlinks.
• It is hard to find an XML parser that is complete,
correct & efficient.
4/24/2025 32
4/24/2025 33
4/24/2025 34
4/24/2025 35