Bonjour,
tout d'abord désolé car je suis débutant en xml / xsl.
j'essaie d'insérer un combo avec des données contenus dans mon xml dans mon xsl.
j'arrive à voir le combo, mais je n'arrive pas à alimenter celui-ci avec les données.
ici mon xml, je souhaite insérer dans mon combo les données contenues dans listeTris :
ici mon xsl :
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
44
45
46
47
48
49
50
51
52 <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="E:\CARTOGRAPHIE\elomap\trunk\ELOMAP2\elomap\rapports\SimulationListeCond.xsl" type="text/xsl"?> <SimulationListeCond> <route> <noRoute>0</noRoute> <description>Champfrémont->Boisville-la-Saint-Père</description> </route> <listeTris> <Tri> <NomTri>Tri 1</NomTri> </Tri> <Tri> <NomTri>Tri 2</NomTri> </Tri> <Tri> <NomTri>Tri 3</NomTri> </Tri> </listeTris> <elements> <element> <conducteur> <noConducteur>186</noConducteur> <description>186 186</description> </conducteur> <distanceDuDepart>92</distanceDuDepart> <TempsJusquauDepart>1h 34m</TempsJusquauDepart> <dateHeureArrivee>20/12/2008 00:57:57</dateHeureArrivee> <distanceFinale>436</distanceFinale> <contrat>200h 00m</contrat> <amplitudeRepos>0h 00m</amplitudeRepos> <jourRepos>0h 00m</jourRepos> <semaineRepos>0h 00m</semaineRepos> <moisRepos>344h 40m</moisRepos> <amplitudeDispo>0h 00m</amplitudeDispo> <jourDispo>0h 00m</jourDispo> <semaineDispo>0h 00m</semaineDispo> <moisDispo>3h 17m</moisDispo> <amplitudeTravail>0h 00m</amplitudeTravail> <jourTravail>0h 00m</jourTravail> <semaineTravail>0h 00m</semaineTravail> <moisTravail>22h 13m</moisTravail> <amplitudeConduite>7h 51m</amplitudeConduite> <jourConduite>7h 51m</jourConduite> <semaineConduite>7h 51m</semaineConduite> <moisConduite>85h 01m</moisConduite> <jourService>7h 51m</jourService> <semaineService>7h 51m</semaineService> <moisService>110h 32m</moisService> </element> </elements> </SimulationListeCond>
merci pour toute aide, le combo avec ce code ne contient rien...
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113 <?xml version="1.0"?> <!-- edited with XMLSpy v2007 sp1 (http://www.altova.com) by crozec (EMBRACE) --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/SimulationListeCond"> <html> <head> <base> <xsl:attribute name="href"><xsl:value-of select="path"/></xsl:attribute> </base> <title>Simulation conducteurs</title> <link rel="stylesheet" href="styles.css" type="text/css"/> </head> <body> <div class="titre">Simulation conducteurs sur le trajet <a class="titre"> <xsl:attribute name="href">ETP://SelectRoute-ID=<xsl:value-of select="route/noRoute"/></xsl:attribute> <xsl:value-of select="route/description"/> </a> </div> <br/> <table> <tr> <th align="left">Trier selon <select> <optgroup label=""> <xsl:value-of select="listeTris/Tri/NomTri" /> <option/> </optgroup> </select> </th> </tr> <xsl:apply-templates select="elements"/> </table> </body> </html> </xsl:template> <xsl:template match="elements"> <xsl:apply-templates select="element"/> </xsl:template> <xsl:template match="element"> <tr> <td bgcolor="#FFFF99" style="font-weight:800"> <a> <xsl:attribute name="href">ETP://SelectMarque-ID=<xsl:value-of select="conducteur/noConducteur"/></xsl:attribute> <xsl:value-of select="conducteur/description"/> </a> <font/> </td> </tr> <tr> <td>Temps d'approche : <xsl:value-of select="TempsJusquauDepart"/> </td> <td> </td> </tr> <tr> <td>Distance d'approche : <xsl:value-of select="distanceDuDepart"/> km </td> <td>Distance totale : <xsl:value-of select="distanceFinale"/> km </td> </tr> <tr> <td>Arrivée : <xsl:value-of select="dateHeureArrivee"/> </td> </tr> <tr> <td> </td> <td align="right">JOUR </td> <td align="right">SEMAINE </td> <td align="right">MOIS </td> </tr> <tr> <td> <xsl:attribute name="bgcolor"><xsl:value-of select="$couleurConduite"/></xsl:attribute> Cumul conduite </td> <td align="right"> <xsl:attribute name="bgcolor"><xsl:value-of select="$couleurConduite"/></xsl:attribute> <xsl:value-of select="jourConduite"/> </td> <td align="right"> <xsl:attribute name="bgcolor"><xsl:value-of select="$couleurConduite"/></xsl:attribute> <xsl:value-of select="semaineConduite"/> </td> <td align="right"> <xsl:attribute name="bgcolor"><xsl:value-of select="$couleurConduite"/></xsl:attribute> <xsl:value-of select="moisConduite"/> </td> </tr> <tr> <td bgcolor="#CCCCCC">Cumul service </td> <td align="right" bgcolor="#CCCCCC"> <xsl:value-of select="jourService"/> </td> <td align="right" bgcolor="#CCCCCC"> <xsl:value-of select="semaineService"/> </td> <td align="right" bgcolor="#CCCCCC"> <xsl:value-of select="moisService"/> </td> </tr> <tr height="4" bgcolor="#000000"/> <tr height="4" bgcolor="#FFFFFF" bordercolor="#FFFFFF"/> <tr height="4" bgcolor="#000000"/> <tr height="4" bgcolor="#FFFFFF" bordercolor="#FFFFFF"/> </xsl:template> </xsl:stylesheet>







Répondre avec citation
Partager