Bonjour,
j'ai un fichier xml:
au quel j'applique le xsl 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 <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet href="feuilleStyle.xsl" type="text/xsl"?> <listeFacture> <facture> <id>num1</id> <designation>fact1</designation> <prix>60</prix> <quantite>16</quantite> </facture> <facture> <id>num2</id> <designation>fact2</designation> <prix>100</prix> <quantite>6</quantite> </facture> <facture> <id>num3</id> <designation>fact3</designation> <prix>50</prix> <quantite>20</quantite> </facture> </listeFacture>
Pour qu'il m'affiche un tableau,jusqu'ici tout marche bien,mais il faut que j'ajoute une ligne ou je met le total des quantités de toutes les factures,le total des prix de toutes les factures...(un total par colonne),j'ai penser à utiliser une variable mais j'y voix pas tres clair!!
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
37
38 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/REC-html40"> <xsl:template match="/"> <html> <body> <table border="1" > <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="listeFacture"> <tr> <th>Id</th> <th>Designation</th> <th>Quantite</th> <th>Prix unitaire</th> <th>Prix total</th> </tr> <xsl:for-each select="facture"> <xsl:sort select="age" order="descending"/> <tr> <td><xsl:value-of select="id"/></td> <td><xsl:value-of select="designation"/></td> <td><xsl:value-of select="quantite"/></td> <td><xsl:value-of select="prix"/></td> <td><xsl:value-of select="prix * quantite"/></td> </tr> </xsl:for-each> </xsl:template> </xsl:stylesheet>
quelqu'un peut il m'aider??
Partager