You are on page 1of 6

WebApp: XML-based Web Application

1
XML Fundamentals

XML Fundamentals

XML is a powerful tool that could improve and enhance a website’s


functionality. It’s a handy tool that every web developer should have. This
module will introduce you to the basic concepts of XML and its applications
in real-life.
Upon completion of this module, you should be able to:
1. Define what is XML
2. Discuss the purpose of XML and its uses
3. Explain the how XML describes data
4. Describe the different XML-related technologies
5. Explain the advantages and disadvantages of XML
6. Discuss the different real-life applications of XML

What is XML?
XML Defined
XML stands for eXtensible Markup Language. It is metalanguage which
allows users to create their own tags especially used to display documents on
the Internet.

Note: It is a standard in exchanging and storing data and information over the
A metalanguage is a internet. Knowledge in XML is a fundamental skill every programmer needs
language that describes to possess.
another language.

Figure 1: A sample XML File

XML is a markup language. A markup language is a set of symbols called


tags added to a document that distinguishes and labels the part of a
document. Markup languages are consist of tags such as <text>…</text> and
<document>…</document>.

HTML vs. XML


HTML is also an example of a markup language. However, it should be noted
that XML is not a replacement or alternative to HTML since;
Course Module
HTML is intended to display data,
Meaning, it takes care of what a document looks like, while
XML is designed to describe data,
Meaning, it focuses on identifying, organizing, and storing data.

Creating Tags using XML


XML is extensible because it allows you to create your own tags. Unlike in
other markup languages like HTML, the tags are predefined.

XML is a W3C Recommendation


XML is recommended by W3C (World Wide Web Consortium). In W3C’s
website it states that
“W3C develops these technical specifications and guidelines through a process
designed to maximize consensus about the content of a technical report, to
ensure high technical and editorial quality, and to earn endorsement by W3C
and the broader community.”
W3C sets the standard of applications used for the Web. HTML and XML are
some of these applications.

Purpose of XML
The following is an overview of the purpose of XML.
1. XML is used to organize and describe information. It takes data and
information, applies structure, and then gives it meaning.
2. XML is intended to be a standard of describing and structuring data over
the internet.
3. XML can bridge the gap between two unrelated systems never intended
to work with each other. For example, creating a new application that will
be used to access data from an older application.

Describing Data using XML


As stated above, XML is used to describe data. Observe the calling card
below:

Figure 2: A simple calling card

You can notice that the information on the right column is described by the
labels form the left column. Without the labels, you will not be able to know
the meaning of the information on the right column.
WebApp: XML-based Web Application
3
XML Fundamentals

Describes
The same concept can be applied to XML. XML tags are used to describe data.
Below is an XML file based on the calling card above.

Figure 3: An XML File based from the calling card example

The tags that you see above (<name>, <address>, <phone>, <email>, and
<BusinessCard>) are all self-defined tags, meaning they are not a predefined
tags of XML. XML can allow the user to create his/her own tag.

XML Related Technologies


The following are some technologies related to XML.
1. XHTML (Extensible Hypertext Markup Language)
You can think of XHTML as a combination of both HTML and XML.

Figure 4: Example of an XHTML Document


Source: http://www.scriptingmaster.com/images/xhtml/XHTML-code.jpg

2. RSS (Really Simple Syndication/Rich Site Summary)


This is a format for delivering dynamic content in the internet. RSS is
commonly found of Blog sites and Web sites.

Course Module
Figure 5: The RSS Logo
Source: https://upload.wikimedia.org/wikipedia/en/thumb/4/43/Feed-icon.svg/1200px-Feed-
icon.svg.png

3. AJAX (Asynchronous JavaScript And XML)


AJAX is a technology well-known for its "asynchronous" nature. It can
communicate, exchange data, and update the page of the server without
having to refresh the page.
4. XPath
This is the syntax for defining parts of an XML document as well as to
extract information on it.
5. XSLT (XML Stylesheet Language Transformation)
This technology takes an XML file and converts it into other format.

Figure 5: The XLST Translation Process


Source: https://tr1.cbsistatic.com/hub/i/2015/06/03/2b60ff17-0989-11e5-940f-
14feb5cc3d2a/diagram1.gif

XML Advantages and Disadvantages


The following are the advantages and disadvantages of XML.
Advantages
1. XML can separate context from presentation
2. XML is an open-format kind of document. Meaning it could be read by
many applications
3. XML can run on both client and server.
4. XML has widespread support on multiple programming languages and
platforms.
Disadvantages
1. XML is not suitable for large datasets.
2. Some data types like images are not represented well.
3. Complex XML code can be difficult to read.

Real-life Applications of XML


The following are some applications of XML in real-life.
1. RSS Feeds on Blogs and Websites
RSS is heavily based on XML. If you visit the link
WebApp: XML-based Web Application
5
XML Fundamentals

http://news.bbc.co.uk/2/hi/help/rss/default.stm

You will see a lot of RSS Feeds available. Websites about the weather and
the news uses RSS Feeds.

2. MS Office XML Formats


XML is currently used to describe the data in MS Office documents.
Visit the link
https://en.wikipedia.org/wiki/Microsoft_Office_XML_formats to see
some examples.

Glossary
AJAX (Asynchronous JavaScript And XML): This is a technology well-
known for its "asynchronous" nature. It can communicate, exchange data,
and update the page of the server without having to refresh the page.
Markup language: This is a set of symbols called tags added to a document
that distinguishes and labels the part of a document.
Metalanguage: This is a language that describes another language.
RSS (Rich Site Summary): This is a format for delivering dynamic content in
the internet
W3C (World Wide Web Consortium): An organization that sets the
standard of applications used for the Web.
XHTML (Extensible Hypertext Markup Language): A combination of both
HTML and XML.
XLST (XML Stylesheet Language Transformation): This technology takes
an XML file and converts it into other format.
XML (Extensible Mark-up Language): This is a standard in exchanging and
storing data and information over the internet.
XPath: This is the syntax for defining parts of an XML document as well as to
extract information on it.

References and Supplementary Materials


Books and Journals
Goldberg, K. H. ;2010; XML Visual Quick Start Guide .2nd Edition; United
States of America; Peachpit
Press.Nguyen, V. ;2017; Using XML. United States of America; Amazon Digital
Services LLC.
Online Supplementary Reading Materials

Course Module
XML Tutorial; https://www.tutorialspoint.com/xml/; Accessed on 8/7/2017
XML Examples; https://www.w3schools.com/xml/xml_examples.asp;
Accessed on 8/7/2017
W3C Standards; https://www.w3.org/standards/; Accessed on 8/7/2017
XHTML; http://searchmicroservices.techtarget.com/definition/XHTML-
Extensible-Hypertext-Markup-Language; Accessed on 8/7/2017
http://w3schools.sinsixx.com/xml/xml_real_life.asp.htm; Accessed on
8/7/2017
What is RSS?; http://www.whatisrss.com/; Accessed on 8/7/2017
AJAX: Getting started; https://developer.mozilla.org/en-
US/docs/AJAX/Getting_Started; Accessed on 8/7/2017
Instructional Videos
XML – Explained in 2 minutes; https://www.youtube.com/watch?v=tZE-
O5KTwCY; Accessed on 8/7/2017
Learn XML Tutorial Part 1;
https://www.youtube.com/watch?v=qgZVAznwX38; Accessed on 8/7/2017

You might also like