<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:param name="navig"/>
<xsl:param name="code"/>
<xsl:variable name="extrait" select="/tableaux_Anny/tableau[type=$code]"/>
<xsl:variable name="repert" select="/tableaux_Anny/repertoire"/>
<!--<xsl:variable name="extrait" select="/tableaux_Anny/tableau[contains($code,type)]"/>-->
<xsl:variable name="fin" select="count($extrait)"/>
<xsl:variable name="nbcol" select="3"/>

<xsl:template match="/">

<html>
  <head>
    <title>Affichage de tableaux, photos, etc.</title>
  </head>
  <body style="font-family:Verdana, Arial, Helvetica;font-size:x-small;"> 
    <br/><a href="index0.html" target="_self">Accueil et/ou autre recherche</a><br/><br/>
    <xsl:value-of select="$fin"/><br/>
    <table border="1" width="80%" cellspacing="1">
    <xsl:call-template name="ligne_tableau"> 
      <xsl:with-param name="debut" select="1"/>
    </xsl:call-template>
    </table>

  </body>
</html>
</xsl:template>

<xsl:template name="ligne_tableau">
 <xsl:param name="debut"/>
 <tr>
 <xsl:for-each select="$extrait">
   <xsl:if test="position()&gt;=$debut and position()&lt;$debut+$nbcol" >
    <!--<xsl:variable name="tableau" select="concat('tableaux/',lien)"/>-->
    <xsl:variable name="tableau" select="concat($repert,'/',lien)"/>
    <td style="border: 0px solid;" width="20%" align="center" valign="middle">
     <a href="{$tableau}" target="_blank">
      <img src="{$tableau}" height="150" align="absmiddle" border="1"></img>
      <br/><xsl:value-of select="titre"/><br/>
     </a><br/>
    </td>
   </xsl:if>
 </xsl:for-each>
 </tr>
 <xsl:if test="$debut+$nbcol&lt;$fin">
  <xsl:call-template name="ligne_tableau"> 
    <xsl:with-param name="debut" select="$debut+$nbcol"/>
  </xsl:call-template>
 </xsl:if>  
</xsl:template>  
   
</xsl:stylesheet>
