The XML Database

Here is the XML database file we will want to display

Note the structure of the file.
It is just a plain text file consisting of data and a series of html type tags which describe that data.

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="winespl.xsl" ?>
<winelist>  
      <wine>
          <name>Hardy's Nottage Hill</name>
          <price>$5.95</price>
          <year>1980</year>
      </wine>   
      <wine>   
          <name>Hardy's White Burgundy</name>
          <price>$10.00</price>
          <year>1985</year>
      </wine>   
      <wine>
          <name>Henscke Hill of Grace</name>
          <price>$50.00</price>
          <year>1985</year>   
      </wine>  
      <wine> 
          <name>Bollinger Champagne</name>
          <price>$100.00</price>   
          <year>1981</year>   
      </wine>   
</winelist>  

Only a small portion of the XML file is actually displayed, although the whole XML file is downloaded to the browser

Note the calling of an XSL Stylesheet (href="winespl.xsl") in line 2.

The XSL style sheet controls how much of the XML data is displayed.

In this example the XSL will loop through the XML file and display wines only if the year equals 1985

We will be using perl to rewrite the XSL file so we can change which part of the XML file is displayed.