Introduction to XML
XML is designed to transport and store data.
HTML is designed to display data.
XML stands for eXtensible Markup Language.
Extensible Markup Language (XML) is a markup language that was derived and simplified from Standard Generalized Markup Language (SGML). It primarily uses Extensible Markup Language, Extensible Stylesheet Language (XSL), XBRL, and XPath, among others.
Basic Knowledge You Should Master
Before you continue your learning, you need to have a basic understanding of the following:
- HTML
- JavaScript
If you wish to learn these subjects first, please visit our homepage for tutorials.
What is XML?
- XML stands for EXtensible Markup Language.
- XML is a markup language much like HTML.
- XML is designed to transport data, not to display data.
- XML tags are not predefined. You must define your own tags.
- XML is designed to be self-descriptive.
- XML is a recommendation of the W3C.
Differences Between XML and HTML
XML is not a replacement for HTML.
XML and HTML are designed for different purposes:
- XML is designed to transport and store data, with focus on what the data is.
- HTML is designed to display data, with focus on how the data looks.
HTML is meant to display information, while XML is meant to transport information.
XML Does Not Do Anything
This might be a bit hard to understand, but XML does not do anything. XML is designed to structure, store, and transport information.
Below is an example of a note from Jani to Tove, stored as XML:
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
This note is self-descriptive. It contains information about the sender and receiver, along with a title and the message body.
However, this XML document does not do anything by itself. It is merely pure information wrapped in XML tags. We need to write software or a program to send, receive, and display this document.
You Can Invent Your Own Tags with XML
The tags in the example above (like <to>
and <from>
) are not defined in any XML standard. These tags were invented by the creator of the XML document.
This is because XML does not have predefined tags.
HTML uses tags that are predefined in the HTML standard. HTML documents can only use tags defined in the HTML standard (such as <p>
, <h1>
, etc.).
XML allows creators to define their own tags and document structure.
XML Is Not a Replacement for HTML
XML complements HTML.
It is important to understand that XML does not replace HTML. In most web applications, XML is used for transporting data, while HTML is used for formatting and displaying that data.
The best description of XML is:
XML is a software and hardware-independent tool for transmitting information.
XML Is a W3C Recommendation
XML became a W3C Recommendation on February 10, 1998.
For more information about W3C's XML activities, please visit our W3C tutorial.
XML Is Ubiquitous
Currently, XML plays a role on the web that is no less significant than HTML, which has been the cornerstone of the web.
XML is the most commonly used tool for data transmission between applications.