What is XML?
XML is method of storing data, togther with tags to explain what it means, and all in plain text. An example of XML is HTML (text with tags explaining how it should be displayed).XML is useful for several reasons.
- Its in plain text, which makes life easier for developers.
- It can be updated, without breaking old programs, simply by adding a new tag to the existing ones.
(e.g. the original HTML standard didn't include tables, so a new TABLE tag was added)
- Its a standard, so different programs can communicate, as long as they speak the same 'DFD'
(tag definition). For example, different web browsers can read the same HTML file.
- The data is structured, so different records can have differant types of tags.
The easiest way of explaining it is to show an example.
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<title>Walking Book</title>
<version>2003/11/11 11:55</version>
<chapters>
<chapter number="1">
<name>Henley (round walk)</name>
<top_10 type="html"></top_10>
<travel type="html">car</travel>
<updates>
<summary type="html">No major changes</summary>
<update>
<book>red</book>
<date></date>
<page></page>
<place></place>
<change>Just below point [8] page 19, there is no road hump sign
down the turning you take.</change>
</update>
<update>
<book>red</book>
<date></date>
<page>24</page>
<place>col 2</place>
<change>Line 3. Should read 70 degrees, not 250 degrees
(correction from Hannah Moss).</change>
</update>
<update>
<book>blue</book>
<date>Jan-03</date>
<page></page>
<place></place>
<change>The footpath from Henley-on-Thames is flooded.
It is not therefore currently possible to do this walk. It may be practicable
to do the end of the walk backwards (given a map) as far as lunch the
Walnut Tree or in Hambleden - returning by the same route.</change>
</update>
<update>
<book>blue</book>
<date>Jan-02</date>
<page>18</page>
<place>lunch</place>
<change>The Walnut Tree at Fawley Green is under new management.</change>
</update>
</chapter>
</chapters>
</document>