Bonjour,
J'ai un XML de ce format:
XSLT:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 <noeud_a param="ee" param2="rrr" param3="eeeee"> <noeud_b> <noeud_c param4="ee" param5="rrr" param6="eeeee"> <noeud_c param4="te" param5="rdr" param6="eesdqeee"> </noeud_b> </noeud_a> .......
Je voudrais savoir comment on peut afficher noeud_c/@param4 des noeuds "noeud_c" ? Avec ce template xslt j affiche 2 fois la meme valeur. Comment indiquer au xslt de prendre le noeud suivant de meme nom ?
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 <xsl:template match="/"> <table> <tr> <th>param</th> <th>param2</th> <th>param3</th> <th>param4</th> <th>param5</th> </tr> <xsl:apply-templates select="noeud_a" /> </table> <xsl:template match="noeud_a"> <tr> <td> <xsl:value-of select="@param" /> </td> <td> <xsl:value-of select="@param2" /> </td> <td> <xsl:value-of select="@param3" /> </td> <td> <xsl:value-of select="noeud_c/@param4" /> </td> <td> <xsl:value-of select="noeud_c/@param4" /> </td> </tr> </xsl:template>
Partager