Bonjour,

Je débute en XML/XSL et j'ai le probleme suivant :
Grace à une procédure PLSQL, je génère le document XML suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="testXMLXSL.xsl"?>
<clients>
 <client>
  <identifiant>1</identifiant>
  <NOM>dupont</NOM>
  <ligneProduit>
    <LIBELLE>ligneProduit1</LIBELLE>
    <PRODUIT>
      <LIBELLE>BENEV</LIBELLE>
    </PRODUIT>
  </ligneProduit>
 </client>
 <client>
   <identifiant>1</identifiant>
   <NOM>dupont</NOM>
   <ligneProduit>
     <LIBELLE>ligneProduit1</LIBELLE>
     <PRODUIT>
        <LIBELLE>CESU</LIBELLE>
     </PRODUIT>
  </ligneProduit>
 </client>
 <client>
   <identifiant>1</identifiant>
   <NOM>dupont</NOM>
   <ligneProduit>
     <LIBELLE>ligneProduit2</LIBELLE>
     <PRODUIT>
        <LIBELLE>CDT</LIBELLE>
     </PRODUIT>
  </ligneProduit>
 </client>
...
 </clients>
et je voudrais obtenir avec une feuille XSLT le document XML suivant (regroupement selon identifiant client et ligne de produit égale):



Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl" href="testXMLXSL.xsl"?>
<clients>
 <client>
  <identifiant>1</identifiant>
  <NOM>dupont</NOM>
  <ligneProduit>
    <LIBELLE>ligneProduit1</LIBELLE>
    <PRODUIT>
      <LIBELLE>BENEV</LIBELLE>
    </PRODUIT>
    <PRODUIT>
      <LIBELLE>CESU</LIBELLE>
    </PRODUIT>
  </ligneProduit>
  <ligneProduit>
     <LIBELLE>ligneProduit2</LIBELLE>
     <PRODUIT>
        <LIBELLE>CDT</LIBELLE>
     </PRODUIT>
  </ligneProduit>
 </client>
 ...
</clients>
Pour le moment j'arrive à faire un regroupement pour les lignes de produits (mais pas pour les produits ... ) avec le code suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
<xsl:output method="xml" />
<xsl:template match="clients">
<table>
<xsl:for-each select='client/identifiant[not(preceding::client/identifiant=.)]'>
	<xsl:sort/>
	<tr>	
		<td><xsl:value-of select='.'/></td>
		<xsl:for-each select='ancestor::clients/client[identifiant=current()]'>
			<xsl:sort/>
 
				<td><xsl:value-of select='ligneProduit/LIBELLE'/></td>
				<td><xsl:value-of select='ligneProduit/PRODUIT/LIBELLE'/></td>
 
		</xsl:for-each>
	</tr>
</xsl:for-each>
</table>
</xsl:template>
</xsl:stylesheet>
Est ce que quelqu'un a déjà eu ce genre de choses à faire ?
Merci pour votre aide !