[XSLT] afficher plusieurs éléments (boucles)
Bonjour!
Voici ma DTD:
Code:
1 2 3 4 5 6 7
| <?xml version="1.0" encoding="iso-8859-1" ?>
<!ELEMENT test (ingrédients)>
<!ELEMENT ingrédients (ingrédient)+>
<!ELEMENT ingrédient (Sucre | Lait | Farine)>
<!ELEMENT Sucre EMPTY>
<!ELEMENT Lait EMPTY>
<!ELEMENT Farine EMPTY> |
Voici mon fichier XML:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE test SYSTEM "test.dtd">
<?xml-stylesheet type="text/xsl" href="test.xsl" ?>
<test>
<ingrédients>
<ingrédient>
<Farine/>
</ingrédient>
<ingrédient>
<Sucre/>
</ingrédient>
</ingrédients>
</test> |
Voici mon fichier XSL:
Code:
1 2 3 4 5 6 7 8 9 10 11
| <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE test SYSTEM "test.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<HTML>
<HEAD> </HEAD>
<BODY> Ingrédient(s) : <xsl:value-of select="name(//test/ingrédients/ingrédient/*)"/>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet> |
Mon problème est que, dans le fichier final, seul le premier ingrédient (Farine) est affiché.
Comment faire pour que les 2 soient affichés?
Merci :-)