[xslt] Utilisation Xml-Image [Débutant]
Bonjour,
je recupere une liste de moto d'un fichier xml et j'ai passé l'url de cette image, je l'ecrit ensuite dans une page html mais les images ne s'affichent pas, cela m'affiche:
<img src="ducati748.jpg">
Voici le code de ma feuille xml (une partie) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
<liste>
<moto><idmoto>1</idmoto>
<marque>ducati</marque>
<modele>748</modele>
<photo>ducati748.jpg</photo>
<couleur>Rouge</couleur>
<annee>1999</annee>
<kilometre>18000</kilometre>
<prix>10000</prix>
</moto>
</liste> |
Voici ma page Xsl:
Code:
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 27 28 29
| <?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" indent="no"/>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
.bg-0 { background-color: #efefff; }
.bg-1 { background-color: #efffef; }
</style>
</head>
<body bgcolor="white" text="black">
<table><xsl:apply-templates match="liste"/></table>
</body>
</html>
</xsl:template>
<xsl:template match="liste">
<xsl:for-each select="moto">
<tr class="bg-{position() mod 2}">
<td>Marque: <xsl:value-of select="marque"/></td>
<td>Modèle: <xsl:value-of select="modele"/></td>
<td>Couleur: <xsl:value-of select="couleur"/></td>
<td>Image: <img src="<xsl:value-of select="photo"/>"></td>
</tr>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> |
Que modifier pour afficher les images?
merci d'avance