Bonjour je suis débutant dans le XML / XSL, voici mon fichier XML :
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 <?xml version="1.0" encoding="UTF-8" ?> <Brainstorm> <topic TopicID="T1"> <text>Groupe</text> <prop> <id>1</id> <label>Groupe</label> <value>Toto</value> </prop> <topic TopicID="T1.1"> [<text>Profil de base</text> </topic> </topic> </Brainstorm>
Et le fichier XSL suivant :
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 <?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" indent="yes"/> <xsl:template match="topic"> <OBJET Code="GROUPE" IdType="21"> <PROPRIETE Nom="Titre"> <xsl:value-of select="prop/value"/> </PROPRIETE> <xsl:template match="/topic"> <OBJET Code="PROFIL" IdType="21"><xsl:value-of select="text"/></OBJET> </xsl:template> </OBJET> </xsl:template> </xsl:stylesheet>
J'essaye d'imbriquer des template pour pouvoir récuperer les profils de chaque groupe mais cela ne fonctionne pas.
Pouvez-vous me donner une solution ?
Merci.
Partager