﻿<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="livre">
<html>
  <head>
    <title><xsl:value-of select="titre" /></title>
  </head>
  <body>
    <h1><xsl:value-of select="titre" /></h1>
    <xsl:choose>
      <xsl:when test="not(@photo='non')">
        <p><img src="images/{@isbn}.jpg"
          alt="Couverture du livre &quot;{titre}&quot;" /></p>
      </xsl:when>
      <xsl:otherwise>
        <p><em>Image de couverture non disponible</em></p>
      </xsl:otherwise>
    </xsl:choose>
    <hr/>
    <xsl:apply-templates />
    <hr/>
  </body>
</html>
</xsl:template>

<xsl:template match="auteurs">
  <p><strong>Auteur(s) :</strong></p>
  <ul>
    <xsl:apply-templates />
  </ul>
</xsl:template>

<xsl:template match="auteur">
  <li><xsl:value-of select="." /></li>
</xsl:template>

<xsl:template match="titre">
  <p><strong>Titre :</strong> <xsl:value-of select="." /></p>
</xsl:template>

<xsl:template match="édition">
  <p><strong>Édition :</strong> <xsl:value-of select="." /></p>
</xsl:template>

</xsl:stylesheet>
