#!/bin/csh -f
cat >xml.htm <<%
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
   <title>An XML document</title>
   <meta name=keywords content="Barry Cornelius,running,race,10K,10M,half marathon,list">
   <link rel="SHORTCUT ICON"
         href="http://www.barrycornelius.com/style/favicon.ico"> 
   <link rel="stylesheet" href="http://www.barrycornelius.com/style/style.css" />
</head>
<body>
<div id="container">
<div id="anybrowser">
<a href="http://www.anybrowser.org/campaign/">
<img src="http://www.anybrowser.org/campaign/bvgraphics/anybrowser3.gif"
width="88" height="31"
border="0"
alt="Best Viewed With Any Browser"
title="Best Viewed With Any Browser"
align="right"></A>
</div>
<!--
<div id="logo">
<img src="/barry.cornelius/style/racesxml.png" 
width="500" height="60"
alt="An XML document containing all the races" 
title="An XML document containing all the races"/>
</div>
-->
<h1>An XML document</h1>
<div id="onlycontent">
&nbsp;
%
cat ../nav.htm >>xml.htm
cat >>xml.htm <<%

<p>
The data for these races is stored in a MySQL database
and various WWW forms fronting a Ruby on Rails application
are used to maintain this database.
</p>

<p>
Every night and also on demand,
two steps happen:
<ol>
<li>
the <code>mysql</code> program is used 
(with a <code>-X</code> option)
to export all the data in the
database to an XML document;
</li>
<li>
six XSL Transformations are used to produce
the five HTML pages and an RSS page
(next.htm, newnext.htm, prev.htm, pb.htm, rest.htm, next.rdf) 
from the XML document.
</li>
</ol>
</p>

<p>
Here is a link to 
<a href="races.xml">the XML document containing details of all the races</a>.
Exactly what happens if you visit this link depends on
the browser you are using.
Modern browsers will attempt to display the XML.
With older browsers, 
you may have to <em>View the Page Source</em>.
Depending on your connection to the internet,
it may take some time to download and for it to be displayed,
as the document is large.
In June 2008, the XML document was about 1.4MB,
and
it grows about 250KB a year.
</p>

<p>
The "future races" page displays
an
<code>iCalendar</code>
button for each race.
When this button is used,
some iCalendar information will be produced.
This is done by executing some XSLT code.
The XSLT code was provided by 
<a href="http://suda.co.uk/">Brian&nbsp;Suda</a>
under the 
<a href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">W3C Open Source License</a>.
The XSLT code is described at
<a href="http://suda.co.uk/projects/X2V/">http://suda.co.uk/projects/X2V/</a>
and it is available from
<a href="http://suda.co.uk/projects/X2V/xhtml2vcard.xsl">http://suda.co.uk/projects/X2V/xhtml2vcard.xsl</a>.
</p>
<p>
The iCalendar information is produced using the mime type
<code>text/calendar</code>.
Exactly what happens at this point
depends on how your browser has been configured.
Either an application will be launched,
or you will be asked whether you want to start an application,
or you will be asked whether you want to save the iCalendar information
to a file.
</p>
</p>

%
cat ~/pub/style/onlycontent.foot >>xml.htm
