XML Data Files

XMLXML stands for EXtensible Markup Language. It is a markup language, similar to HTML, but it was designed to carry data, not to display data. It is designed to be self-descriptive. Unlike HTML, XML tags are not predefined. You must define your own tags. XML does not does not actually do anything – it was created to structure, store and transport information.

XML and HTML were designed for different purposes. XML was designed to transport and store data and focuses on what data is while HTML was designed to display data, and focuses on how data looks. Or, to put it another way, HTML is about displaying information, while XML is about carrying information.

Consider the following note from Douglas to Shiona, stored as XML:


<note>
<to>Shiona</to>
<from>Douglas</from>
<topic>Friday</topic>
<body>
Don't forget that we're meeting at 8:00 pm on Friday evening.
</body>
</note>

This note is self descriptive. It has sender and receiver information, a heading and a message body.┬áBut it doesn’t do anything anything. It is simply information wrapped in tags. We would need a piece of software to send, receive or display it.

Note that the tags in this example, like <to> and <from>, are not defined in any standard. They are invented by the author of the XML document. XML has no predefined tags – it allows authors to define their own tags and document structure.

Compare this with the tags used in HTML, which are predefined. HTML documents can only use tags defined in the HTML standard, like <p>, <h1>, etc., whereas XML allows the author to define his/her own tags and his/her own document structure.

XML can be defined as a software- and hardware-independent tool for carrying information. It became a W3C Recommendation in 1998 and is now is now as important as HTML was in the early days of the Web. It is used for data transmissions between all sorts of applications.

XML is a complex topic, but there are a number of introductory tutorials available online, including this one.

Next: Abstract Data Structures