Basics
In this unit you will learn about XML
technologies. Before you look into the specifications of
XML it is important to understand why XML exists and its advantages.
HTML, the most popular
markup language, has been designed to display data and specify how that data
should look. XML has been designed to describe and structure data. XML itself
does not actually describe how to display data or what to do data. It allows you to structure the data in a
standard manner. This enables other systems to interpret XML. In other words it
provides a ‘interoperable file format" which can be interpreted using
other languages. XSL is the popular language used to transform/interpret XML.
CHARACTERISTICS OF XML
XML stands for ‘Extensible Markup
Language’. XML can be understood as a general-purpose specification used for
creating custom markup languages. It is classified as an extensible language as
it allows its users to define their own elements. Thus it enables users to
create custom tags that suit their requirement. XML has been primarily
developed to information systems share their structured data online. It can be
used to encode documents as well as to serialize data so that it can be
efficiently used. Some of the features
of XML have been summarized below:
1. XML can be
understood as an extensible language which is freely available.
2. XML tags are user made tags.
They are not predefined tags. In case of HTML predefined tags are used (like
,
, etc.). While working with XML author can define his own
tags and develop own document structure.
3. XML is a
Complement to HTML
Book.html
, etc.). While working with XML author can define his own
tags and develop own document structure.
3. XML is a
Complement to HTML
4. XML is not a replacement for
HTML. Both scripting languages have their own purpose. As web is developing XML
is being popularly used to describe the data and HTML will be used to format
and display the same data.
5. XML
has been inherited from SGML
SGML stands for Standard Generalized Markup
Language. It is an ISO standard that defines an extremely powerful markup
language. It is popularly used in the
publishing industry and large manufacturing companies. It can be
understood as the meta language that can be used to create other markup languages such as HTML.
It marks the origin of XML.
XML is a markup language like the Hypertext
Markup Language (HTML) which is commonly used for scripting web page. XML is specifically designed to describe data
so that it can be effectively stored online. Web today contains such vast information.
XML enables structuring of data so that it can then be mined to get suitable
information. In case of XML unlike HTML
there are no predefined tags. XML can
also be called as self-descriptive markup language as users need to define
their on tags.
For
better understanding check out the example below:
Suppose
you are storing information about a set of books. You may store the information
in html as follows:
< html >
< head > <title > Storing
Information< /title >
< body>
< p > Linear Programming by A.S. Bajaj < br >
< p > Marketing Research by
Kotler </p >
< /body >
< /html >
In
the above example you can see that you can easily define data in an XML file.
The file shows that there is a catalogue containing books, each of which
contains title and author detail of the book. You can see that XML the file
size in XML is more then the other file size. You may feel that XML will loss
in efficiency those results from this increased size. However XML makes this
loss by speeding up the processing of a well-defined XML file. The way you interpret an html file is
dependent on the pre-defined tags available in html. In contrast XML file tags
are user defined and represent a piece of information in a hierarchical manner.
Such kind of data which describes is also called metadata. Such data provides
great strength to XML as you can easily create your own specifications and
structure the data in the way you want it to be interpreted by any other
system.
3.2.1 Difference between HTML and XML
It is very important for you to understand
that you will not use XML for replacing HTML. Both XML and HTML have been designed for
different goals which can be summarized as follows:
- XML is designed specifically to describe data where as HTML is
designed to display data.
- XML is focused on defining data with its attributes. It basically
tells what data is all about. HTML is focused on presentation of data and
is used to customize looks of data.
- In case of HTML Document tags
to be used and the structure of the documents are predefined. You can only
use tags that are defined in the HTML standard. In case of XML you can
define your own tags and develop your own document structure.
- An XML document is saved with
an extension .XML whereas an HTML document is saved as .HTML.
E.g.
The following example is an
e-mail from Ram to Shyam stored as XML
Ram
Shyam
Hi how are you?
Let’s go for a New Year party
In above example e-mail has been stored using
XML markup language. You can see that own tags have been created to store the
names of sender and receiver. Similarly different tags have been created to
store the subject and content of the web page.
Comments