<?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" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:myNS="http://devedge.netscape.com/2002/de"
 xmlns:xi="http://www.w3.org/2001/XInclude">
<xsl:output method="html" encoding="utf-8"/>
<xsl:include href="http://www.gexperthaiti.com/xml/Liens.xsl"/>
 <xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
<head>
  <meta http-equiv="Content-Type" content="text/html"/>
  <meta name="dc.title" content="Departements de la republique d'Haiti"/>
  <meta name="dc.creator" content="Daniel Godefroy"/>
  <meta name="dc.subject" content="Haiti, Departements, Geographie, Economie"/>
  <meta name="dcterms.created" content="2006-10-01"/>
  <meta name="dc.language" content="fr"/>
  <meta name="dc.identifier" content="www.gexperthaiti.com"/>
  <meta name="description" content="Departements de la republique d'Haiti"/>

  <title><xsl:value-of select="Departements/@NOM"/></title>
<link rel="schema.dc" href="http://purl.org/dc/elements/1.1/"/>
<link rel="schema.dcterms" href="http://purl.org/dc/terms/"/>
   </head>
<body> <table border="1" style="width:100%;">
	    <xsl:apply-templates select="Departements"/>
</table>
</body>
</html> 
</xsl:template> 
<xsl:template match="Departements">
	    <xsl:apply-templates select="Image"/>
	<h1><xsl:value-of select="@NOM"/></h1>
	<xsl:apply-templates select="Departement"/>
</xsl:template>
<xsl:template match = "Departement">
<h2>Nom:<xsl:value-of select="Nom"/></h2>
Identification=<xsl:value-of select="@id"/> ; Numero=<xsl:value-of select="Num"/>;
Superficie:<xsl:value-of select="Superficie"/>km<sup>2</sup>
<xsl:apply-templates select="Resumes"/>
<xsl:apply-templates select="Arrondissements"/>
<xsl:apply-templates select="Statistiques"/>
</xsl:template>
<xsl:template match = "Resumes">
	<h3>Description du departement</h3>
<xsl:apply-templates select="Resume"/>
</xsl:template>
<xsl:template match = "Statistiques">
	<h3>Statistiques du departement</h3>
<table border="1">
              <tr> <thead>
              <th align="left">Source</th>
              <th align="left">Periode</th>
              <th align="left">Densite</th>
              <th align="left">Hommes</th>
              <th align="left">Femmes</th>
              <th align="left">Plus 18 ans</th>
              <th align="left">Population</th>
              <th align="left">Population urbaine</th>
              <th align="left">Population rurale</th>
              <th align="left">Population Quartiers</th>
              <th align="left">Population Sections</th>
            </thead></tr>
 <xsl:apply-templates select="Statistique"/>
 </table>
</xsl:template>
<xsl:template match = "Arrondissements">
	<h3>Arrondissements du departement</h3>
<table border="1">
              <tr>  <thead>
              <th align="left">Code</th>
              <th align="left">Nom</th>
              </thead>    </tr>
 <xsl:apply-templates select="Arrondissement"/>
 </table>
</xsl:template>
<xsl:template match = "Resume">
	<h4>Source:<xsl:value-of select="@source"/> pour la periode:<xsl:value-of select="@periode"/></h4>
	<xsl:apply-templates select="p"/>
	<xsl:value-of select="text()"/>
</xsl:template>
<xsl:template match="Arrondissement">
             <tr>
                <td>
                  <xsl:value-of select="text()"/>
                </td>
                <xsl:apply-templates select="Lienc"/>
  </tr>
</xsl:template>
<xsl:template match="Statistique">
             <tr>
                <td>
                  <xsl:value-of select="@source"/>
                </td>
                <td>
                  <xsl:value-of select="@periode"/>
                </td>
                <td>
                  <xsl:value-of select="Densite"/>
                </td>
               <td>
                  <xsl:value-of select="Population_masculin"/>
                </td>
               <td>
                  <xsl:value-of select="Population_feminin"/>
                </td>
                <td>
                  <xsl:value-of select="Population_18ans_plus"/>
                </td>
                <td>
                  <xsl:value-of select="Total_population"/>
                </td>
                <td>
                  <xsl:value-of select="Population_Urbaine"/>
                </td>
                <td>
                  <xsl:value-of select="Population_Rurale"/>
                </td>
                <td>
                  <xsl:value-of select="Population_Quartiers"/>
                </td>
                <td>
                  <xsl:value-of select="Population_Sections"/>
                </td>
  </tr>
</xsl:template>
<xsl:template match="Prevu">
<td>  <xsl:choose>
<xsl:when test="Montant"><xsl:value-of select="Montant"/></xsl:when>
<xsl:otherwise><xsl:value-of select="text()"/></xsl:otherwise>
 </xsl:choose></td>
</xsl:template>
<xsl:template match="Realise">
<td> <xsl:value-of select="Montant"/> </td>
<td> <xsl:value-of select="Date"/> </td>
<td> <xsl:value-of select="Beneficiaire"/> </td>
</xsl:template>
<xsl:template match = "Activites">
<tr>
<td>
<table border="1">
              <tr bgcolor="yellow">
              <th align="left">Activites prevues</th>
              <th align="left">Resultats prevus</th>
              <th align="left">Achevement</th>
             </tr>
<xsl:apply-templates select="Activite"/>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Activite">
<tr>
<td> <xsl:value-of select="text()"/> </td>
<xsl:apply-templates select="Livrables"/>
</tr>
</xsl:template>
<xsl:template match = "Livrables">
<!-- table border="1">
              <tr bgcolor="green">
              <th align="left">Resultats prevus</th>
              <th align="left">Achevement</th>
             </tr-->
<xsl:apply-templates select="Livrable"/>
</xsl:template>
<xsl:template match="Livrable">
<td> <xsl:value-of select="text()"/> </td>
<xsl:apply-templates select="Achevement"/>
</xsl:template>
<xsl:template match="Achevement">
<td> <xsl:value-of select="text()"/> </td>
</xsl:template>
<xsl:template match = "Responsabilites">
<tr bgcolor="red"><td>Responsables de l'execution du projet</td></tr>
<tr><td>
<table border="1">
              <tr bgcolor="yellow">
              <th align="left">Responsable</th>
              <th align="left">Titre</th>
              <th align="left">Nbre heures</th>
              <th align="left">Salaire horaire</th>
              <th align="left">Cout</th>
              <th align="left">Periode</th>
              <th align="left">Remarque</th>
              </tr>
<xsl:apply-templates select="Responsabilite"/>
 <td/>   <td>Total</td>
    <td>  <xsl:value-of select="sum(Responsabilite/Cout/Heure)"/> </td>
 <td/>
    <td>  <xsl:value-of select="sum(Responsabilite/Cout/Montant)"/> </td>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Responsabilite">
<tr>
  <td>
    <xsl:value-of select="text()"/>
 </td>
 <xsl:apply-templates select="Titre"/>
 <xsl:apply-templates select="Cout"/>
</tr>
</xsl:template>
<xsl:template match="Titre">
<td> <xsl:value-of select="text()"/> </td>
</xsl:template>
<xsl:template match="Temps">
<td> <xsl:value-of select="text()"/> </td>
</xsl:template>
<xsl:template match="Salaire">
<td> <xsl:value-of select="text()"/> </td>
<td> <xsl:value-of select="Periode"/> </td>
</xsl:template>
<xsl:template match="Cout">
       <td>  <xsl:value-of select="Heure"/> </td>
       <td>  <xsl:value-of select="Salaire"/> </td>
       <td>  <xsl:value-of select="Montant"/> </td>
       <td> <xsl:value-of select="Temps"/> </td>
       <td>  <xsl:value-of select="Remarque"/> </td>
</xsl:template>
<xsl:template match = "Indices">
<tr>
<td>
<table border="1">
              <tr bgcolor="red">
              <th align="left">Indices d'evaluation</th>
             </tr>
<xsl:apply-templates select="Indice"/>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Indice">
<tr>
<td> <xsl:value-of select="text()"/> </td>
</tr>
</xsl:template>
<xsl:template match = "Revenus">
<tr>
<td>
<table border="1">
              <tr bgcolor="red">
              <th align="left">Sources de revenus du projet</th>
             </tr>
<xsl:apply-templates select="Revenu"/>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Revenu">
<tr>
<td> <xsl:value-of select="text()"/> </td>
<xsl:apply-templates select="Budgets"/>
</tr>
</xsl:template>
<xsl:template match = "Budgets">
<tr>
<td>
<table border="1">
              <tr bgcolor="yellow">
              <th align="left">Periode</th>
              <th align="left">Prevu</th>
              <th align="left">Realise</th>
              <th align="left">Date realisation</th>
             </tr>
<xsl:apply-templates select="Budget"/>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Budget">
<tr>
<td> <xsl:value-of select="@periode"/> </td>
	<xsl:apply-templates select="Prevu"/>
	<xsl:apply-templates select="Realise"/>
</tr>
</xsl:template>
<xsl:template match = "Depenses">
<tr>
<td>
<table border="1">
              <tr bgcolor="red">
              <th align="left">Source de depenses du projet</th>
              <th align="left">Categorie de depenses</th>
            </tr>
<xsl:apply-templates select="Depense"/>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match = "Sources">
<tr>
<td>
<table border="1">
              <tr bgcolor="red">
              <th align="left">Sources de financement</th>
              <th align="left">Nature</th>
              <th align="left">Prevu</th>
              <th align="left">Realise</th>
              <th align="left">Solde</th>
             </tr>
<xsl:apply-templates select="Source"/>
<tr><td>Total</td>  <td/>
<td>  <xsl:value-of select="sum(Source/Montant)"/> </td>
<td>  <xsl:value-of select="sum(Source/Realises/Realise/Montant)"/> </td>
<td>  <xsl:value-of select="sum(Source/Montant) - sum(Source/Realises/Realise/Montant)"/> </td>
</tr>
 </table>
</td>
</tr>
</xsl:template>
<xsl:template match="Source">
<tr>
<td> <xsl:value-of select="text()"/> </td>
<td> <xsl:value-of select="Nature"/> </td>
<td> <xsl:value-of select="Montant"/> </td>
<xsl:apply-templates select="Realises"/>
<!--
<td> <xsl:value-of select="Realise/Montant"/> </td>
<td> <xsl:value-of select="Realise/Date"/> </td>
 --></tr>
</xsl:template>
<xsl:template match = "Realises">
<td>
<table border="1">
              <tr bgcolor="yellow">
              <th align="left">Realisation</th>
              <th align="left">Date</th>
             </tr>
             <xsl:apply-templates select="Realise"/>
<tr>
<td>  <xsl:value-of select="sum(Realise/Montant)"/> </td>
</tr>
</table>
</td>
</xsl:template>
<xsl:template match="Depense">
<tr>
<td> <xsl:value-of select="text()"/> </td>
<td> <xsl:value-of select="@categorie"/> </td>
<xsl:apply-templates select="Sources"/>
<xsl:apply-templates select="Budgets"/>
</tr>
</xsl:template>
<xsl:template match = "Budgets">
<tr>
<td>
<table border="1">
              <tr bgcolor="yellow">
              <th align="left">Periode</th>
              <th align="left">Prevu</th>
              <th align="left">Realise</th>
              <th align="left">Date realisation</th>
              <th align="left">Beneficiaire</th>
             </tr>
<xsl:apply-templates select="Budget"/>
<tr><td>Total</td>
<td>  <xsl:value-of select="sum(Budget/Prevu/Montant)"/> </td>
<td>  <xsl:value-of select="sum(Budget/Realise/Montant)"/> </td>
</tr>
</table>
</td>
</tr>
</xsl:template>
<xsl:template match = "Exigences">
<tr><table border="1">
              <tr bgcolor="red">
              <th align="left">Exigences techniques</th>
              <th align="left">Sujet</th>
             </tr>
<xsl:apply-templates select="Exigence"/>
</table> </tr>
</xsl:template>
<xsl:template match="Exigence">
              <tr>
                <td>
                  <xsl:value-of select="text()"/>
                </td>
                <td>
                  <xsl:value-of select="Sujet"/>
                </td>
</tr>
</xsl:template>
<xsl:template match = "Recommandations">
<table border="1">
              <tr bgcolor="red">
              <th align="left">Recommandations techniques</th>
              <th align="left">Sujet</th>
             </tr>
<xsl:apply-templates select="Recommandation"/>
</table>
</xsl:template>
<xsl:template match="Recommandation">
              <tr>
                <td>
                  <xsl:value-of select="text()"/>
                </td>
                <td>
                  <xsl:value-of select="Sujet"/>
                </td>
</tr>
</xsl:template>
<xsl:template match = "Documents">
<table border="1">
              <tr bgcolor="red">
              <th align="left">Documents techniques</th>
              <th align="left">Fichier</th>
              <th align="left">Chemin</th>
              <th align="left">Url</th>
             </tr>
<xsl:apply-templates select="Document"/>
</table>
</xsl:template>
<xsl:template match="Document">
              <tr>
                <td>
                  <xsl:value-of select="text()"/>
                </td>
                <td>
                  <xsl:value-of select="Fichier/text()"/>
                </td>
                <td>
                  <xsl:value-of select="Fichier/Chemin"/>
                </td>
                <td>
                  <xsl:value-of select="Url"/>
                </td>
</tr>
</xsl:template>
</xsl:stylesheet>


