Bonjour à tous :
quelqu'un pourriez m'aider s'il vous plait :
voici mon problème je dispose d'un document XML :
concert.xml
voici mon fichier xsl:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <?xml version="1.0" encoding="ISO-8859-1"?> <Concert> <Entete> CONCERT DU SIECLE </Entete> <Date>Jeudi 17 Janvier 2002 </Date> <Lieu> BERCY</Lieu> <Interpretes> <Nom> PATRIC BRUEL </Nom> <Nom> CELINE DION </Nom> <Nom> CLAUDE FRENCOIS</Nom> </Interpretes> </Concert>
xml-to-html.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 <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="ISO-8859-1" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="/"> <html> <head> <title> </title></head> <body> <xsl:apply-templates select="//*"/> </body> </html> </xsl:template> <xsl:template match="*"> <p> <xsl:value-of select="name()"/> <xsl:text>: </xsl:text> <xsl:value-of select="node()"/> </p> </xsl:template> </xsl:stylesheet>
voici le resultat:
Concert: CONCERT DU SIECLE
Entete: CONCERT DU SIECLE
Date: Jeudi 17 Janvier 2002
Lieu: BERCY
Interpretes: PATRIC BRUEL
Nom: PATRIC BRUEL
Nom: CELINE DION
Nom: CLAUDE FRENCOIS
Ce que je voudrai comme resultat: ne rien affiche pour les balise vide
Concert:
Entete: CONCERT DU SIECLE
Date: Jeudi 17 Janvier 2002
Lieu: BERCY
Interpretes:
Nom: PATRIC BRUEL
Nom: CELINE DION
Nom: CLAUDE FRENCOIS
Merci de votre aide
Partager