<?xml version="1.0"?>

<!-- advo.xsl version 1.1 -->

<!--
     XSLT Stylesheet for converting an Advogato diary to HTML 
     Copyright (C) 2002 Dan York - dyork@lodestar2.com

     This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
     as published by the Free Software Foundation; either version 2
     of the License, or (at your option) any later version.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You can obtain a copy of the GPL at 
     http://www.fsf.org/copyleft/gpl.html or by writing tothe 
     Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
     Boston, MA  02111-1307, USA.

-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

<!-- Specify that the output is HTML and turn on indenting so that,
     if indenting is supported by the XSLT processor, the resulting
     HTML file will look pretty.  -->

<xsl:output method="html" indent="yes" />

<!-- Preserve any whitespace in the source XML document. -->

<!--  Commented out for the moment.
<xsl:preserve-space elements="*"/>
  -->

<!-- ====================================================== -->


<!-- Obviously you will need to modify the references in the text
     below.  -->

<xsl:template match="/">
<html>
  <head>
   <title>Dan York's Advogato Diary</title>
  </head>
  <body bgcolor="#FFFFFF">
   <h1>Advogato Diary of Dan York</h1>
   <p>This is a backup copy of the diary I maintain at
      <a href="http://www.advogato.org/">Advogato</a>, a site where
      many people in the open source/Linux community maintain web logs. You
      can <a href="http://www.advogato.org/person/dyork/">read the original
      version there</a> in reverse chronological order (newest first).</p>

   <p>Just because it was easiest to do, and more interesting on one level,
      I have left the entries in chronological order here.  If you wish, you
      may <a href="#end">jump to the end</a> to see the newest entries.</p>

   <p>This site is synced with the main Advogato site each night.</p>

   <xsl:apply-templates select="*"/>
  <a name="end"></a>
  </body>
</html>
</xsl:template>

<!-- Format each entry as a H2 and with a horizontal rule above it. -->

<xsl:template match="entry">
    <hr/>
    <h2><xsl:value-of select="date"/></h2>
    <xsl:apply-templates/>
</xsl:template>

<!-- Do nothing when encountering these elements as they have already been
     explicitly used in the template above. -->

<xsl:template match="date"/>

<!-- ====================================================== -->

<xsl:template match="contents">
    <xsl:apply-templates/>
</xsl:template>

<!-- This just copies the HTML part of each advo entry directly to the
     output HTML file.  -->

<xsl:template match="html">
    <xsl:copy-of select="*"/>
</xsl:template>

</xsl:stylesheet>
