Bonjour,
Voici le fichier que je lis :
<?xml version="1.0" encoding="ISO-8859-1"?>
<factures>
<entete>
<nbrEntete>101</nbrEntete>
<numclientEnt>115207</numclientEnt>
<numDocumentEnt>800756839</numDocumentEnt>
<typeDocEnt>F</typeDocEnt>
<dateFactureEnt>01102008</dateFactureEnt>
<echeanceFactureEnt>05102008</echeanceFactureEnt>
<resteABlancEnt/>
</entete>
<ligne>
<nbrDetail>201</nbrDetail>
<numClient>115207</numClient>
<numAvenant>481463</numAvenant>
<numimmatric>108AVG</numimmatric>
<nomConduct/>
<structure/>
<codeGenre>VP</codeGenre>
<refExtClient>524</refExtClient>
<codeProduit>LLOY</codeProduit>
<libelleProduit>Loyer financier</libelleProduit>
<montantHT>488,98</montantHT>
<montantTVA>95,84</montantTVA>
<montantTTC>584,82</montantTTC>
<codeDevise>EUR</codeDevise>
<tauxTVA>19,60</tauxTVA>
<dateDebPresta>01102008</dateDebPresta>
<dateFinPresta>31102008</dateFinPresta>
<resteABlanc/>
</ligne>
<ligne>
<nbrDetail>201</nbrDetail>
<numClient>115207</numClient>
<numAvenant>481463</numAvenant>
<numimmatric>108AVG</numimmatric>
<nomConduct/>
<structure/>
<codeGenre>VP</codeGenre>
<refExtClient>524</refExtClient>
<codeProduit>LMAIASS</codeProduit>
<libelleProduit>Maintenance & Assistance</libelleProduit>
<montantHT>103,26</montantHT>
<montantTVA>20,24</montantTVA>
<montantTTC>123,50</montantTTC>
<codeDevise>EUR</codeDevise>
<tauxTVA>19,60</tauxTVA>
<dateDebPresta>01102008</dateDebPresta>
<dateFinPresta>31102008</dateFinPresta>
<resteABlanc/>
</ligne>
<pied>
<nbrPied>301</nbrPied>
<numclientPied>115207</numclientPied>
<numDocumentPied>800756839</numDocumentPied>
<typeDocPied>F</typeDocPied>
<dateFacturePied>01102008</dateFacturePied>
<montantHTPied>726,39</montantHTPied>
<montantTVAPied>136,83</montantTVAPied>
<montantTTCPied>863,22</montantTTCPied>
<codeDevisePied>EUR</codeDevisePied>
<resteABlancPied/>
</pied>
<entete>
<nbrEntete>101</nbrEntete>
<numclientEnt>334229</numclientEnt>
<numDocumentEnt>800757637</numDocumentEnt>
<typeDocEnt>F</typeDocEnt>
<dateFactureEnt>01102008</dateFactureEnt>
<echeanceFactureEnt>01112008</echeanceFactureEnt>
<resteABlancEnt/>
</entete>
<ligne>
<nbrDetail>201</nbrDetail>
<numClient>334229</numClient>
<numAvenant>517270</numAvenant>
<numimmatric>401AXK</numimmatric>
<nomConduct>ANNE SOPHIE</nomConduct>
<structure/>
<codeGenre>VP</codeGenre>
<refExtClient>149</refExtClient>
<codeProduit>LLOY</codeProduit>
<libelleProduit>Loyer financier</libelleProduit>
<montantHT>438,59</montantHT>
<montantTVA>85,96</montantTVA>
<montantTTC>524,55</montantTTC>
<codeDevise>EUR</codeDevise>
<tauxTVA>19,60</tauxTVA>
<dateDebPresta>01102008</dateDebPresta>
<dateFinPresta>31102008</dateFinPresta>
<resteABlanc/>
</ligne>
<ligne>
<nbrDetail>201</nbrDetail>
<numClient>334229</numClient>
<numAvenant>517270</numAvenant>
<numimmatric>401AXK</numimmatric>
<nomConduct>ANNE SOPHIE</nomConduct>
<structure/>
<codeGenre>VP</codeGenre>
<refExtClient>149</refExtClient>
<codeProduit>LMAIASS</codeProduit>
<libelleProduit>Maintenance & Assistance</libelleProduit>
<montantHT>67,41</montantHT>
<montantTVA>13,21</montantTVA>
<montantTTC>80,62</montantTTC>
<codeDevise>EUR</codeDevise>
<tauxTVA>19,60</tauxTVA>
<dateDebPresta>01102008</dateDebPresta>
<dateFinPresta>31102008</dateFinPresta>
<resteABlanc/>
</ligne>
<pied>
<nbrPied>301</nbrPied>
<numclientPied>334229</numclientPied>
<numDocumentPied>800757637</numDocumentPied>
<typeDocPied>F</typeDocPied>
<dateFacturePied>01102008</dateFacturePied>
<montantHTPied>638,17</montantHTPied>
<montantTVAPied>119,53</montantTVAPied>
<montantTTCPied>757,70</montantTTCPied>
<codeDevisePied>EUR</codeDevisePied>
<resteABlancPied/>
</pied>
</factures>
voici mon xslt :
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns0="http://127.0.0.1:880/" xmlns:XQHeaderFunc="java:com.sonicsw.xq.service.xform.HeaderExtension" xmlns:saxon="http://saxon.sf.net/" xmlns:XQMessageElem="http://www.sonicsw.com/sonicxq/com.sonicsw.xq.service.xform.TransformationElementFactory" extension-element-prefixes="XQMessageElem" xmlns:str="http://BI.EU.FR.REI.nullcompensation" exclude-result-prefixes="str xs saxon XQHeaderFunc xs tns0">
<xsl:output method="xml" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="/factures">
<Factures>
<xsl:for-each select="entete">
<Record>
<CODE_FOUR>52035</CODE_FOUR>
<FACT_FOU>
<xsl:value-of select="numDocumentEnt"/>
</FACT_FOU>
<DATE_FAFO>
<xsl:value-of select="dateFactureEnt"/>
</DATE_FAFO>
<xsl:for-each select="../pied">
<DEVISE>
<xsl:value-of select="codeDevisePied"/>
</DEVISE>
<TOTAL_HT>
<xsl:value-of select="montantHTPied"/>
</TOTAL_HT>
<TOTAL_TTC>
<xsl:value-of select="montantTTCPied"/>
</TOTAL_TTC>
</xsl:for-each>
<DTAE_ECH>
<xsl:value-of select="echeanceFactureEnt"/>
</DTAE_ECH>
<MODE_REG>
</MODE_REG>
<CODE_STE>10</CODE_STE>
<TYPE>
<xsl:choose>
<xsl:when test="typeDocEnt = 'F'">FAC</xsl:when>
<xsl:otherwise>AV</xsl:otherwise>
</xsl:choose>
</TYPE>
<Liste_Cdes>
<Commande>
<NUM_CDE>
</NUM_CDE>
<REFIMPCDE>
</REFIMPCDE>
<Lignes_Facture>
<xsl:for-each select="../ligne">
<Ligne>
<REF_ART>
<xsl:value-of select="codeProduit"/>
</REF_ART>
<MONTANT>
<xsl:value-of select="montantHT"/>
</MONTANT>
<TAUX_TVA>
<xsl:value-of select="tauxTVA"/>
</TAUX_TVA>
<PU_REMISE>
<xsl:value-of select="montantHT"/>
</PU_REMISE>
<QUANTITE>1</QUANTITE>
<DESIGNAT>
<xsl:value-of select="libelleProduit"/>
</DESIGNAT>
<NUM_LIG>
<xsl:value-of select="position()"/>
</NUM_LIG>
</Ligne>
</xsl:for-each>
</Lignes_Facture>
</Commande>
</Liste_Cdes>
</Record>
</xsl:for-each>
</Factures>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Et voici ce que je souhaiterais obtenir
<?xml version="1.0" encoding="iso-8859-1"?>
<Factures>
<Record>
<CODE_FOUR>52035</CODE_FOUR>
<FACT_FOU>800756839</FACT_FOU>
<DATE_FAFO>01102008</DATE_FAFO>
<DEVISE>EUR</DEVISE>
<TOTAL_HT>726,39</TOTAL_HT>
<TOTAL_TTC>863,22</TOTAL_TTC>
<DTAE_ECH>05102008</DTAE_ECH>
<MODE_REG/>
<CODE_STE>10</CODE_STE>
<TYPE>FAC</TYPE>
<Liste_Cdes>
<Commande>
<NUM_CDE/>
<REFIMPCDE/>
<Lignes_Facture>
<Ligne>
<REF_ART>LLOY</REF_ART>
<MONTANT>488,98</MONTANT>
<TAUX_TVA>19,60</TAUX_TVA>
<PU_REMISE>488,98</PU_REMISE>
<QUANTITE>1</QUANTITE>
<DESIGNAT>Loyer financier</DESIGNAT>
<NUM_LIG>1</NUM_LIG>
</Ligne>
<Ligne>
<REF_ART>LMAIASS</REF_ART>
<MONTANT>103,26</MONTANT>
<TAUX_TVA>19,60</TAUX_TVA>
<PU_REMISE>103,26</PU_REMISE>
<QUANTITE>1</QUANTITE>
<DESIGNAT>Maintenance & Assistance</DESIGNAT>
<NUM_LIG>2</NUM_LIG>
</Ligne>
</Lignes_Facture>
</Commande>
</Liste_Cdes>
</Record>
<Record>
<CODE_FOUR>52035</CODE_FOUR>
<FACT_FOU>800757637</FACT_FOU>
<DATE_FAFO>01102008</DATE_FAFO>
<DEVISE>EUR</DEVISE>
<TOTAL_HT>638,17</TOTAL_HT>
<TOTAL_TTC>757,70</TOTAL_TTC>
<DTAE_ECH>01112008</DTAE_ECH>
<MODE_REG/>
<CODE_STE>10</CODE_STE>
<TYPE>FAC</TYPE>
<Liste_Cdes>
<Commande>
<NUM_CDE/>
<REFIMPCDE/>
<Lignes_Facture>
<Ligne>
<REF_ART>LLOY</REF_ART>
<MONTANT>438,59</MONTANT>
<TAUX_TVA>19,60</TAUX_TVA>
<PU_REMISE>438,59</PU_REMISE>
<QUANTITE>1</QUANTITE>
<DESIGNAT>Loyer financier</DESIGNAT>
<NUM_LIG>8</NUM_LIG>
</Ligne>
<Ligne>
<REF_ART>LMAIASS</REF_ART>
<MONTANT>67,41</MONTANT>
<TAUX_TVA>19,60</TAUX_TVA>
<PU_REMISE>67,41</PU_REMISE>
<QUANTITE>1</QUANTITE>
<DESIGNAT>Maintenance & Assistance</DESIGNAT>
<NUM_LIG>9</NUM_LIG>
</Ligne>
</Lignes_Facture>
</Commande>
</Liste_Cdes>
</Record>
</Factures>
Merci de votre aide ...