Bonjour, j'ai du mal à afficher tous les valeurs d'un élément avec xslt, à chaque fois il m'affiche juste la première valeur. Veuillez m'aider s'il vous plait.
Voici la question:"Écrivez un document xsl qui affiche pour chaque cours, son titre, ces auteurs et ces tuteurs."
Et voici mon code:
Code xml : 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 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <table border="1"> <th>Titre</th> <th>Auteur</th> <th>Tuteur</th> <th>Resumé</th> <th>Mots-clés</th> <th>Objectifs</th> <th>Prérequis</th> <xsl:for-each select="ListeCours/cours"> <tr> <td><xsl:value-of select="Titre"/></td> <td><xsl:value-of select="auteurs/auteur"/></td> <td><xsl:value-of select="tuteurs/tuteur"/></td> <td><xsl:value-of select="Resume"/></td> <td><xsl:value-of select="motscles/motcle"/></td> <td><xsl:value-of select="objectifs/objectif"/></td> <td><xsl:value-of select="prerequis"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
Partager