php - How to display an image inside a HTML table using XSL code? -
i created xsl style sheet xml web service. have image link output database on html. xsl display link not image link contain. want display direct image inside html table using xsl.
this xsl code
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <html> <body> <h2>birdcatch xslt</h2> <table border="1"> <tr bgcolor="#9acd32"> <th>id</th> <th>species</th> <th width="50%">about_bird</th> <th>date_added</th> <th>address</th> <th>age</th> <th>sex</th> <th>latitiude</th> <th>longitiude</th> <th>image</th> <th>added_by</th> </tr> <xsl:for-each select="birdcatch/birds/bird"> <tr> <td><xsl:value-of select="@id" /></td> <td><xsl:value-of select="species" /></td> <td><xsl:value-of select="about_bird" /></td> <td><xsl:value-of select="date_added" /></td> <td><xsl:value-of select="address" /></td> <td><xsl:value-of select="age" /></td> <td><xsl:value-of select="sex" /></td> <td><xsl:value-of select="location/latitiude" /></td> <td><xsl:value-of select="location/longitiude" /></td> <td><xsl:value-of select="image" /></td> <td><xsl:value-of select="added_by" /></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
i want display image in image col column in table. how can this?
instead of:
<td><xsl:value-of select="image" /></td>
try:
<td><img src="{image}"></img></td>
untested, because no xml source provided.
Comments
Post a Comment