<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- ______________________________________________________________    -->
<!-- Stylesheet for "travaux.dtd" by Vivian Synteta, Copyright 2003    -->
<!-- Language: French    ________________________________________      -->
<!-- Changes: 22/10/2003 ________________________________________       -->
<!-- ____________________________________________________________      -->


  <xsl:template match="student">
    <html>
      <head>
        <title>
          Page Travaux STAF 
        </title>
      </head>
      <body bgcolor="white">
        <h1>PAGE TRAVAUX</h1>
        <h2>Données Personnelles</h2>
        <xsl:apply-templates select="personal-data"/>	
        <h2>Exercises STAF</h2>
        <xsl:apply-templates select="courses"/>
      </body>
      </html>
    </xsl:template>


    <xsl:template match="personal-data">
      <ul>
        <li><b>Nom : </b><xsl:value-of select="first-name"/>&#160;<xsl:value-of select="family-name"/></li>
        <li><b>Promotion : </b><xsl:value-of select="promotion"/></li>
        <li><b>URLs : </b>(Homepage) <a href="{homepage-url}"><xsl:value-of select="homepage-url"/></a>&#160;(Email) <a href="mailto:{email}"><xsl:value-of select="email"/></a></li>
        <li><b>Logins : </b>(Unix) <xsl:value-of select="unix-login"/>&#160;(MOO) <xsl:value-of select="moo-login"/></li>
      </ul>
    </xsl:template>
    
    <xsl:template match="courses"> 
	Table of contents: 
	<xsl:apply-templates select="course/title" mode="toc"/>
	<xsl:apply-templates />
    </xsl:template>
  
    <xsl:template match="course/title" mode="toc">
  	<a href="#{.}"><xsl:value-of select="." /></a> 
	(<xsl:apply-templates select="../exercise/exercise-number" mode="toc"/>) |   
    </xsl:template>

    <xsl:template match="exercise/exercise-number" mode="toc">
  	<a href="#{../../title}-Ex{.}">
		Ex<xsl:value-of select="." /> 
	</a> - 
    </xsl:template>

    <xsl:template match="course">
      <a name="{title}"></a>	
      <h3>COURS: <a href="{url}"><xsl:value-of select="title"/></a>, Enseignant: <xsl:value-of select="instructor"/></h3> 
        <xsl:apply-templates select="exercise"/>
    </xsl:template>

    <xsl:template match="exercise"> 	
    <p>
      <a name="{../title}-Ex{exercise-number}"></a>	
      Ex<xsl:value-of select="exercise-number"/>.&#160;<xsl:value-of select="title"/>
      <ul>
        <xsl:apply-templates select="sections"/>
      </ul>
    </p>
  </xsl:template>

    <xsl:template match="sections"> 
  <xsl:for-each select="section">
    <xsl:sort select="."/>
    <p>
	<xsl:number level="multiple"
                 count="exercise|section"
                 format="1.1 "/>

      (<xsl:value-of select="deposit-date"/>) <a href="{url}"><xsl:value-of select="title"/></a>
      <br />
      <b>Description :</b> <xsl:value-of select="description"/>
      <xsl:if test="status">
        <br />
        <b>Status:</b> <xsl:value-of select="status"/>
      </xsl:if> 
      <xsl:if test="participants">
        <br /> 
        <b>Participants : </b><xsl:value-of select="participants"/>
      </xsl:if>
      <xsl:if test="comments">
        <br /> 
        <b>Comments : </b><xsl:value-of select="comments"/>
      </xsl:if>
    </p>
  </xsl:for-each>	
    </xsl:template>
  
</xsl:stylesheet>

