xslt & image in a table

admin

Administrator
Staff member
I have this xsl file that works for my xml document, but I cant get the images in the FILM_GENRE attribute to sow up in the table. They show up above the table, then the table shows the attribute value. I need the image to show up instead of the string value. Could anyone please help me out? Thank you in advance!



<xsl:template match="FILMS">



<table width ="600" border="2">
<tr>

<td>Film Title</td>
<td>Film Genre</td>
<td>Film Rating (max 5)</td>
<td>Ambiance (max 5)</td>
<td>Average Entry Cost</td>
<td>Review</td>
</tr>





<xsl:for-each select="FILM">

<xsl:sort select="AMBIANCE_RATING" data-type="number" order="ascending"/>






<tr>

<td><xsl:value-of select="NAME"/></td>


<td><xsl:value-of select="@FILM_GENRE"/></td>

<xsl:choose>
<xsl:when test="@FILM_GENRE='Chinese'">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"chinese.jpg"/></xsl:when>
<xsl:when test="@FILM_GENRE='Western'">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"western.jpg"/></xsl:when>
<xsl:when test="@FILM_GENRE='Comedy'">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"comedy.jpg"/></xsl:when>
<xsl:otherwise>Not Applicable</xsl:otherwise>
</xsl:choose>


<td><xsl:value-of select="FILM_RATING"/></td>

<td><xsl:value-of select="AMBIANCE_RATING"/></td>

<td><xsl:value-of select="AVERAGE_ENTRY_COST"/></td>

<td><xsl:value-of select="REVIEW"/></td>
 
Back
Top