<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="html" encoding="utf-8"/>
 <xsl:template match="/">
    <html>
 <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title><xsl:value-of select="Documentation/@NOM"/></title>
   </head>
      <body>
  <table border="1">
	<xsl:apply-templates select="Documentation"/>
</table>
</body>
</html> 
</xsl:template> 
<xsl:template match = "Documentation">
         <tr bgcolor="red">
      		<th align="left"><h2>  	<xsl:value-of select="@NOM"/>
</h2></th>
   	</tr>
	<xsl:apply-templates select="Classe"/>
</xsl:template>
<xsl:template match = "Classe">
<!-- Liste des classes du systene -->
<tr>
<td>
<table border="1">
              <tr bgcolor="red">
                <th align="left">Classe</th>
                <th align="left">Description</th>
              </tr>
              <tr>
                <td>
                  <xsl:value-of select="@NOM"/>
                </td>
                <td>
                  <xsl:value-of select="text()"/>
                </td>
             </tr>
 	<xsl:if test="Attributs">
 			<xsl:apply-templates select="Attributs"/>
	</xsl:if>
	<xsl:if test="Methodes">
	</xsl:if>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Attributs">
		<tr>
		<td>
		<table border="1">
                  	<tr bgcolor="#9acd32">
                  	  <th align="left">Attribut</th>
                  	  <th align="left">Genre</th>
                  	  <th align="left">Description</th>
                		  </tr>
			<xsl:apply-templates select="Attribut"/>
           	 </table>
		</td>
		</tr>
</xsl:template>
<xsl:template match="Attribut">
<!-- Liste des attributs de la classe -->
<tr>
  <td>
  	<xsl:value-of select="@Clipper"/>
  </td>
  <td>
  	<xsl:value-of select="@Genre"/>
  </td>
  <td>
        <xsl:value-of select="text()"/>
  </td>
 </tr>
</xsl:template>
<xsl:template match="Methodes">
		<tr>
		<td>
		<table border="1">
                  	<tr bgcolor="orange">
                    	<th align="left">Methode</th>
                    	<th align="left">Nom implementation</th>
                    	<th align="left">Description</th>
                  	</tr>
 			<xsl:apply-templates select="Methode"/>
           	</table>
		</td>
		</tr>
</xsl:template>
<xsl:template match="Methode">
<!--Liste des Methodes de la classe -->  
<tr>
<td>
	<tr>
                  <td>
                        <xsl:value-of select="@Nom"/>
                  </td>
                  <td>
                        <xsl:value-of select="@Clipper"/>
                  </td>
                  <td>
                  	<xsl:value-of select="text()"/>
                  </td>
	</tr>
	<xsl:if test="Signature"> 
  		<xsl:apply-templates select="Signature"/>
	</xsl:if>
	<xsl:if test="Resultat"> 
  		<xsl:apply-templates select="Resultat"/>
	</xsl:if>
</td>
</tr>
</xsl:template>  
<xsl:template match="Signature">
<tr>
<td>
<table border="1">
                  <tr bgcolor="yellow">
                    <th align="left">Signature</th>
                    <th align="left">Parametre</th>
                    <th align="left">Domaine</th>
	 <xsl:if test="Parametre">
		<xsl:apply-templates select="Parametre"/>
	</xsl:if>
                   </tr>
</table>
</td>
</tr>
</xsl:template>
<xsl:template match="Resultat">
<tr>
<td>
<table border="3">
                  <tr bgcolor="yellow">
                    <th align="left">Resultat</th>
                    <th align="left">Parametre</th>
                    <th align="left">Domaine</th>
                 </tr>
  	<xsl:if test="Parametre">
		<xsl:apply-templates select="Parametre"/>
	</xsl:if>
</table>
</td>
</tr>
</xsl:template>
<xsl:template match="Parametre">
                   <tr>
			<td>
			  <xsl:value-of select="Position"/>
			  <!--xsl:value-of select="position()"/-->
			</td>
                      	<td>
                      	  <xsl:value-of select="text()"/>
                      	</td>
                      	<td>
                      	  <xsl:value-of select="@Domaine"/>
                      	</td>
                     </tr>
 </xsl:template>
</xsl:stylesheet>
