Evolution of XML
In order to address the issues raised by earlier markup languages, the Extensible Markup Language (XML) was created XML is a W3C recommendation.
XML is a set of rules for defining semantic tags that break a document into parts and identify the different parts of the document. XML was developed over HTML because of the basic differences between them.
HTML was designed to display data.
XML was designed to carry data.
HTML displays data and focuses on how data looks.
XML describes data and focuses on what data is.
HTML displays information.
XML describes information.
FIG: Difference between HTML and XML
An XML code:
<?xml version=”1.0” encoding=”iso-8859-1”?>
<description> A bright brown fox jumps over the lazy dog</description>
Features of XML
Features of XML are as follows:
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 DTD or an XML Schema to describe the data
XML with a DTD or XML Schema is designed to be self-descriptive
XML markup defines the physical and logical layout of the document. XML can be considered as an information container. It contains shapes labels. Structures and also protects information. XML employs a tree-based structure to represent a document. The basic foundation of XML is laid down by symbols embedded in the text known as markup. The markup combines the text and extra information about the text such as its structure and presentation. The markup divides the information into a hierarchy of character data and container-like elements and its attributes. A number of software programs process electronic documents use a markup.
XML’s markup divides a document into separate information containers calld elements. A document consists of one outermost element called root element that contains all the other elements. Plus some optional administrative information at the top. Known as XML declaration. Following code demonstrates the elements.
<?xml version=”1.0” encoding=”iso-8859-1” ?>
<Description>Red in color</Description>
<Name>, <Price>, <Description> and <Number> inside the tags are elements.
<FlowerPlanet> and </FlowerPlanet> are the root elements.
The usage of XML can be observed in many real-life scenarios. It can be used in the fields of information sharing, single application usage, content delivery, re-use of data, separation of data and presentation, semantics, and so forth. News agencies are a common place where XML is used. News producers and news consumers often use a standard specification name XMLNews to produce, retrieve, and relay information across different systems in the world.
Note: XML is a subset of SGML, with the same goals, but with as much of the complexity eliminated as possible. This means that any document which follows XML’s syntax rules will also follow SGML’s syntax rules, and can therefore be read by existing SGML tools.