Voici mon fichier XML
J'aimerais pouvoir afficher une table qui affiche pour chaque appelation tous les chateaux. (memes ceux qui n'appartiennent pas à l'appelation, c'est encore lointain pour moi!! mais si vous avez la solution, je suis preneur!!)
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
39
40
41
42
43 <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="monfichierdemoi2.xsl"?> <ANNUAIRE> <APPELATION> <ID_APPELATION>01</ID_APPELATION> <NOM_APPELATION>Saint Estèphe</NOM_APPELATION> </APPELATION> <APPELATION> <ID_APPELATION>02</ID_APPELATION> <NOM_APPELATION>Saint Julien</NOM_APPELATION> </APPELATION> <APPELATION> <ID_APPELATION>03</ID_APPELATION> <NOM_APPELATION>Cahors</NOM_APPELATION> </APPELATION> <CHATEAU> <ID_APPELATION>01</ID_APPELATION> <ID_CHATEAU>0101</ID_CHATEAU> <NOM_CHATEAU>chateau bellevue</NOM_CHATEAU> <ADRESSE_CHATEAU>12 rue du pont</ADRESSE_CHATEAU> <TEL_CHATEAU>055656565656</TEL_CHATEAU> </CHATEAU> <CHATEAU> <ID_APPELATION>01</ID_APPELATION> <ID_CHATEAU>0102</ID_CHATEAU> <NOM_CHATEAU>chateau lacroute</NOM_CHATEAU> <ADRESSE_CHATEAU></ADRESSE_CHATEAU> <TEL_CHATEAU></TEL_CHATEAU> </CHATEAU> <CHATEAU> <ID_APPELATION>02</ID_APPELATION> <ID_CHATEAU>0201</ID_CHATEAU> <NOM_CHATEAU></NOM_CHATEAU> <ADRESSE_CHATEAU></ADRESSE_CHATEAU> <TEL_CHATEAU></TEL_CHATEAU> </CHATEAU> ...
Exemple :
Saint estephe
chateau bellevue
chateau lacroute
Saint truc
chateau bellevue
chateau lacroute
Tout simplement...mais je n'y arrive pas!! voici mon code XSL :
Merci d'avance!!
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
39 <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title align="center">vive le vin rouge</title> </head> <body> <xsl:apply-templates select="ANNUAIRE"/> </body> </html> </xsl:template> <xsl:template match="ANNUAIRE"> <p><b><center>Vive les poivrots</center></b></p> <table border="1" cellspacing="0" cellpadding="3"> <tr bgcolor="#FFFF00"> <td>NOM_APPELATION</td> </tr> <xsl:apply-templates select="APPELATION"/> </table> </xsl:template> <xsl:template match="APPELATION"> <tr> <td><xsl:value-of select="NOM_APPELATION"/></td> </tr> <xsl:apply-templates select="CHATEAU"/> </xsl:template> <xsl:template match="CHATEAU"> <tr> <td><xsl:value-of select="NOM_CHATEAU"/></td> </tr> </xsl:template> </xsl:stylesheet>
Partager