Bonjour à tous ,
voila mon probleme est le suivant:
je veux affiche dans un tableau tous les articles et les quantite chacun dans un colonne :
le fichier xsl:
et le fichier xml:
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 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> <xsl:template match="/"> <!--<xsl:variable name="numero" select="gestion/commande[@numCo='Co1235']/@numCo"/>--> <!--<xsl:variable name="numero1" select="compagne/personnel[@nomP='duracuire']/@numP"/>--> <table border="1" cellspacing="0" width="100%"> <tr bgcolor="yellow"> <td width="30%">numarticle</td> <td width="30%">qteCo</td> </tr> <!--<xsl:for-each select="gestion/commande[@numCo=$numero]">--> <xsl:for-each select="gestion/commande[@numCo='Co1235']"> <tr> <td width="30%"><xsl:for-each select="article/@numarticle"> <xsl:value-of select="."/> </xsl:for-each></td><br /> <td width="30%"><xsl:for-each select="article/@qteCo"> <xsl:value-of select="."/> </xsl:for-each></td><br /> </tr> </xsl:for-each> </table> </xsl:template> </xsl:stylesheet>
et voir le pièce -jointe pour voir le resultat donnee
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 <?xml version="1.0" encoding="iso-8859-1"?> <gestion> <client numc="C123" nomc="DUPONT"/> <client numc="C124" nomc="DURAND"/> <client numc="C125" nomc="DUBOIS"/> <client numc="C126" nomc="DUVAL"/> <commande numCo="Co1237" dateCo="10/10/2008" numC="C124"> <article numarticle="A9876" qteCo="25"/> <article numarticle="A8765" qteCo="30"/> </commande> <commande numCo="Co1235" dateCo="09/10/2008" numC="C123"> <article numarticle="A7654" qteCo="43"/> </commande> <commande numCo="Co1234" dateCo="08/10/2008" numC="C125"> <article numarticle="A6547" qteCo="23"/> </commande> <commande numCo="Co1235" dateCo="09/10/2008" numC="C126"> <article numarticle="A9876" qteCo="12"/> <article numarticle="A5367" qteCo="20"/> <article numarticle="A7654" qteCo="30"/> </commande> </gestion>
Partager