Thursday 14 May 2015

What is XML ?

A little bit about HTML

Hypertext Markup Language, a standardized system for tagging text files to achieve font, colour, graphic, and hyperlink effects on World Wide Web pages.
The tags used to markup HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard.


What is XML

It allows the author to define his own tags and his own document structure.
It stands for EXtensible Markup Language
It is a markup language much like HTML
It was designed to describe data, not to display data
Its tags are not predefined. You must define your own tags
It is designed to be self-descriptive

The Difference Between XML and HTML

1. XML is not a replacement for HTML.
2. XML and HTML were designed with different goals:
3. XML was designed to describe data, with focus on what data is
4. HTML was designed to display data, with focus on how data looks
5. HTML is about displaying information, while XML is about carrying information.

what do XML?

XMl is use only for carrying data. Its do not do any thing esle.

Sample Example:-
  <Message>
  <to>Amit</to>
  <from>Rampal</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</Message>

Defining own your tags:-
With XML You can Invent Your Own Tags
The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document.
That is because the XML language has no predefined tags.

The tags used in HTML are predefined. HTML documents can only use tags defined in the HTML standard (like <p>, <h1>, etc.).
XML allows the author to define his/her own tags and his/her own document structure.
XML is Not a Replacement for HTML
XML is a complement to HTML.

Example 2:-

<?xml version="1.0" encoding="UTF-8" ?>
<Employee>

<Persion1>
<Name>Ramesh</Name>
                        <Gender>Male</Gender>
<EmailId>abc@gmail.com</EmailId>
<MobileNo>8861447949</MobileNo>
<Address>844 Ganesg PG Rajaji Nagar Bangluru</Address>
<City>Bangluru</City>
<Country>India</Country>
                        <Pin>560010</Pin>
</Persion1>
                <Persion2>
<Name>Kiran</Name>
                        <Gender>Female</Gender>
<EmailId>def@gmail.com</EmailId>
<MobileNo>8904801563</MobileNo>
<Address>366 Hitech city Madhavpur Hyderabad</Address>
<City>Bangluru</City>
<Country>India</Country>
                        <Pin>111003</Pin>
</Persion2>

</Employee>

Note:- It is important to understand that XML is not a replacement for HTML. In most web applications, XML is used to describe data, while HTML is used to format and display the data.
XML is a software- and hardware-independent tool for carrying information.




No comments:

Post a Comment