Markup Language for documents containing structured information
Defined by four specifications:
XML , the eXtensible Markup Language
XLL , the eXtensible Linking Language
XSL , the eXtensible Style Language
XUA , the XML User Agent
Based on Standard Generalized Markup Language (SGML) ISO-8879 .
Version 1.0 introduced by World Wide Web Consortium (W3C) in 1998 .
Bridge for data exchange on the Web .
XML is cross platform , hardware & software independent language .
An XML document is attached
to a Document Type Definition
which describes its structure .
Comparisons XML & HTML XML HTML
Extensible set of tags
Standard Data infrastructure
Allows multiple output forms
Fixed set of tags
No data validation capabilities
Processing Instruction :
XML document usually begins with the Processing Instruction(PI).
Example of a PI statement -
<?xml version=“1.0” encoding=“UTF-8”?>
Tags are used to identifying data.
Data is marked-up by using tags.
Opening & Closing angular bracket(<>) are enclose the name of the Tags.
Basic units used to identify and describe data .
Elements are represented by using tags .
XML document must have a root element .
Example of a content –
<BOOKNAME> The Painted House</BOOKNAME>
Information represented by the element is referred as the content of that element .
Contents are further divided into :-
Attributes provide additional information .
Elements can have one or more attributes .
Attribute consists of a name value pair .
It is a good programming practice .
Example of comment entry –
<!– PRODUCTDATA is the root element -->
Comments are used to explain the code .
Document Type Definition (DTD) :
DTD defines the structure of the content of an XML document .
It specifies the elements along with their attributes that can be present in the XML document .
Types of DTD –
XML Schema :
It is used to define the structure of XML document.
It defines the list if elements & attributes .
An XML Schema also specifies the order in which the elements appear & also their data types .
Feature DTD Schema Syntax Non – XML syntax XML syntax Namespaces No Support Supports Namespaces Inheritance No Support Supports Inheritance Data Type Support Limited to String format Wide range of data types including , string , real , etc. Applicability Wide spread due to many years of practical application Comparatively New
XML is used to exchange structured documents over internet .
XML can be used as a format to transfer structured data between heterogeneous systems as it is platform independent .
XML can be used effectively with applications like Java .
XML can be used to create new languages e.g. WML , VRML .
It is based on International Standards .
It has User Specific Vocabulary , i.e. user defined tags can be created .
The Hierarchical Structure is suitable for almost all types of documents .
It is platform independent , thus relatively immune to changes in technology .
XML provides the feature of conditional formatting of a document which HTML does not provide .
Forward & backward compatibility are easy to maintain despite the changes in DTD or Schema .
Repetition : In XML every element and attribute name for every element and attribute instance has to be repeated .
External References : The biggest performance risk for XML comes from the fact that it can include external files .