Bonjour, voilà je débute en XML et je fais des petits test pas très concluant. Ca ne marche ni sous FF ni sous IE.
Voici mon fichier XML:
voici mon fichier .xslt
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 <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xslt" href="essai.xslt"?> <racine> <enfant> <nom>Loïc</nom> <lien>garçon</lien> <date>07/11/83</date> <data>Le petit qui me dépasse d'une tête.</data> </enfant> <enfant> <nom>Marine</nom> <lien>fille</lien> <date>20/12/85</date> <data>La petite fille chérie à son papa.</data> </enfant> </racine>
au niveau de l'affichage j'ai soit toutes les données bout à bout soit le style mais sans données.
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 <?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" version="1.0" encoding="ISO-8859-1" indent="yes"/> <xsl:template match="/racine"> <html xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <body style="font-family:Arial; font-size:12pt;"> <xsl:for-each select="racine/enfant"> <div style="background-color:teal; color:white;"> <span style="font-weight:bold; color:white; padding:4px"> <xsl:value-of select="nom"/> </span> - <xsl:value-of select="lien"/> <br /> </div> <div style="margin-left:20px; font-size:10pt"> Anniversaire le <xsl:value-of select="date"/> <span style="font: 10px verdana;color: red"> - <xsl:value-of select="data"/> </span> </div> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet>
Partager