Bonjour!
Voici ma DTD:
<?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:
<?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:
<?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 :-)
