<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:doc="http://www.aasted.org/DOCUMENT">


<xsl:template match="doc:document">

    <html>
    <head> <title> <xsl:value-of select="@title"/> </title> </head>    
    
    <style>
        a:visited {
            color: rgb(0,0,255);
            text-decoration: none;
        }
        
        a {
            color: rgb(0,0,255);
            text-decoration: none;
        }
        
        a:hover {
            color: rgb(51,153,255);
            text-decoration: underline;
        }
    </style>
    
    <body style=" font-family: sans-serif;">
    <div style="font-size: medium; text-align: center;">
        <b><xsl:value-of select="@title"/></b>
    </div>
    <div style="font-size: small; text-align:center; font-family: sans-serif;">
        <xsl:variable name="mail" select="doc:author/doc:e-mail"/>        
        <a href="mailto:{$mail}"> <xsl:value-of select="doc:author/text()"/></a>
    </div>    
    
    <div style="margin-left: 10em; margin-top: 2em;">
    <b>Index</b><br/>
    <xsl:apply-templates select="doc:chapter"/>
    <br/>
    <a href="content.php">All chapters</a>
    </div>
    </body>    
    </html>    
</xsl:template>

<xsl:template match="doc:chapter">    
    <xsl:value-of select="position()"/>. <a href="content.php?ch={position()}"><xsl:value-of select="@title"/></a><br/>
    <xsl:apply-templates select="doc:section"/>
</xsl:template>

<xsl:template match="doc:section">
<!--
    <xsl:if test="@title">
        <div style="margin-left: 2em;">
           <i><xsl:value-of select="@title"/></i>
        </div>
    </xsl:if>        
-->    
</xsl:template>


</xsl:stylesheet>