Bonjour, je débute en XSL et XMl, j'ai un fichier XML de ce type :
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129 <departements> <departement> <nomDep>DRH</nomDep> <flux> <nomFlux>fluxRSS5.xml</nomFlux> <title>W3Schools Home Page</title> <link>http://...</link> <description>Free web building tutorials</description> <webMaster></webMaster> <category>tutorial</category> <docs></docs> <image>image2.gif</image> <pubDate>2007-08-10</pubDate> <publier>oui</publier> <item> <title>google</title> <link>http://www.google.fr</link> <description>recherche</description> <author>toto</author> <category>rechercheeee</category> <comments>none</comments> <pubDate>2007-08-01</pubDate> <source>none</source> </item> <item> <title>gôôgle</title> <link>http://www.google.com</link> <description>recherche</description> <author /> <category /> <comments /> <pubDate>2007-08-03</pubDate> <source /> </item> </flux> <flux> <nomFlux>fluxRSS3.xml</nomFlux> <title>fluxRSS3</title> <link>dspRssAllItem.aspxXML=fluxRSS.xml&XSL=dspRssAllItem.xsl&history=300</link> <description /> <webMaster /> <category /> <docs /> <image /> <pubDate>2007-08-10</pubDate> <publier>oui</publier> </flux> <flux> <nomFlux>b.xml</nomFlux> <title>b</title> <link>dspRssAllItem.aspxXML=b.xml&XSL=dspRssAllItem.xsl&history=300</link> <description /> <webMaster /> <category /> <docs /> <image /> <pubDate>2007-08-13</pubDate> <publier>oui</publier> <item> <title>new1</title> <link>new</link> <description>new</description> <author>new</author> <category>new</category> <comments>new</comments> <pubDate>2007-08-01</pubDate> <source>new</source> </item> <item> <title>new2</title> <link>new</link> <description /> <author /> <category /> <comments /> <pubDate>2007-08-15</pubDate> <source /> </item> </flux> </departement> <departement> <nomDep>Marketing</nomDep> <flux> <nomFlux>rrs2.xml</nomFlux> <title>rrs2</title> <link>dspRssAllItem.aspx?XML=rrs2.xml&XSL=dspRssAllItem.xsl&history=300</link> <description /> <webMaster /> <category /> <docs /> <image /> <pubDate>2007-08-14</pubDate> <publier>oui</publier> <item> <title>google</title> <link>www.google.fr</link> <description /> <author /> <category /> <comments /> <pubDate>2007-08-14</pubDate> <source /> </item> </flux> <flux> <nomFlux>Rss2.xml</nomFlux> <title>Rss2</title> <link>dspRssAllItem.aspx?XML=Rss2.xml&XSL=dspRssAllItem.xsl&history=300</link> <description /> <webMaster /> <category /> <docs /> <image /> <pubDate>2007-08-14</pubDate> <publier>oui</publier> </flux> <flux> <nomFlux>a2.xml</nomFlux> <title>a2</title> <link>dspRssAllItem.aspx?XML=a2.xml&XSL=dspRssAllItem.xsl&history=300</link> <description /> <webMaster /> <category /> <docs /> <image /> <pubDate>2007-08-14</pubDate> <publier>oui</publier> </flux> </departement> </departements>
Je veux que pour chq département s'affiche tous les flux et que les items de chq flux soient affichés.
Avec le code ci-dessous ça m'affiche les flux de tous les departements dans chaque département càd (par ex.) pour la DRH ça m'affiche les flux de la DRH ainsi que ceux de marketing.
Comment je peux faire pour le pouvoir trier les informations?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <xsl:template match="/"> <h3 align="center">Flux RSS de tous les départements</h3> <xsl:for-each select ="/departements/departement"> <br/> <xsl:value-of select="nomDep"/> <xsl:for-each select ="/departements/departement/flux"> <xsl:value-of select="nomFlux"/> <br/> </xsl:for-each> </xsl:for-each> </xsl:template>
Partager