XML Features
XML is widely used in the era of web development. It is also used to simplify data storage and sharing.
Main features of XML are given below.
XML Separates Data from Presentation
XML does not carry any information about how to be displayed.
The same XML data can be used in many different presentation scenarios.
Therefore, with XML, there is a complete separation between data and presentation.
XML simplifies data sharing
In the real world, computer systems and databases contain data in incompatible formats.
XML data is stored in a plain text format. This provides a software and hardware independent way to store data.
This significantly facilitates the generation of data that can be shared by different applications.
XML simplifies data transport
Exchanging data over the Internet is often complex because there are different formats for representing data and the systems are often incompatible with each other.
Using XML reduces the complexity since it is a representation that can be read by incompatible applications.
XML simplifies Platform change
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.
XML increases data availability
With XML, your data can be available to all kinds of "reading machines" (handheld computers, voice machines, news feeds, etc.), and make it more available to the blind, or people with other disabilities.
XML can be used to create new languages
Many new Internet languages are created with XML.
For example:
- XHTML
- WSDL for describing available web services
- WAP and WML as markup languages for handheld devices
- RSS languages for news feeds
- RDF and OWL for describing resources and ontology
- SMIL for describing multimedia for the web
Example
Represent a list of emails using XML:
<?xml version="1.0" encoding="UTF-8"?>
<emails>
<email>
<to>Tom</to>
<from>Ryan</from>
<heading>Hello</heading>
<body>Hello brother, how are you!</body>
</email>
<email>
<to>Peter</to>
<from>Jack</from>
<heading>Birth day wish</heading>
<body>Happy birth day Tom!</body>
</email>
<email>
<to>James</to>
<from>Jacklin</from>
<heading>Morning walk</heading>
<body>Please start morning walk to stay fit </body>
</email>
<email>
<to>Liz</to>
<from>Vince</from>
<heading>Health Tips</heading>
<body>Smoking is injurious to health </body>
</email>
</emails>