Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
thisisreallyfunky #1
Using an XSL with <img> tag
I'm using XSL to transform my XML. In my XSL I want to display an image using
the <img> tag. I can not figure how to get the image to display. The code makes
the image missing icon be displayed. When I do a right click|Properties on the
image icon I see: Thumbnail, or I get an error. Below is my .xsl file and I
would like some feedback on the <img> tag section, like how to make images
display!
Thanks in advance,
Bob
xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" />
<xsl:template match="/Artworks">
<html>
<head>
<title>Bondi Studios Online Gallery</title>
</head>
<body>
<h3>Bondi Studios Online Gallery</h3>
<table border="1" width="80%" cellpadding="2" cellspacing=
"1" bgcolor="#999999">
<tr bgcolor="#dedede">
<th>Name</th>
<th>Date</th>
<th>Filename</th>
<th>Thumbnail</th>
<th>Medium</th>
<th>Price</th>
<th>Dimensions</th>
</tr>
<xsl:for-each select="Artwork">
<tr bgcolor="#ffffff">
<td><xsl:value-of select="Name"/></td>
<td><xsl:value-of select="Date"/></td>
<td><xsl:value-of select="Filename"/></td>
<td><img src='<xsl:value-of select="Thumbnail"/>'</img></td>
<td><xsl:value-of select="Medium"/></td>
<td><xsl:value-of select="Price"/></td>
<td><xsl:value-of select="Dimensions"/></td>
</tr>
<tr>
<td height="128" width="96">
<img src="Thumbnail"></img>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
thisisreallyfunky Guest
-
gumshoe #2
Re: Using an XSL with <img> tag
<td><img src='<xsl:value-of select="Thumbnail"/>'</img></td>
I count 4 '>' , but 5 '<'. Looks like the '<img src ...' section needs to be
terminated before you then do the enclosing </img>.
Take away the xsl:value-of and you basically did this:
<img src="blah" </img>
"thisisreallyfunky" <webforumsuser@macromedia.com> wrote in message
news:cvqr67$7dc$1@forums.macromedia.com...> I'm using XSL to transform my XML. In my XSL I want to display an image
> using
> the <img> tag. I can not figure how to get the image to display. The code
> makes
> the image missing icon be displayed. When I do a right click|Properties
> on the
> image icon I see: Thumbnail, or I get an error. Below is my .xsl file and
> I
> would like some feedback on the <img> tag section, like how to make images
> display!
>
> Thanks in advance,
> Bob
>
> xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="html" />
> <xsl:template match="/Artworks">
> <html>
> <head>
> <title>Bondi Studios Online Gallery</title>
> </head>
> <body>
> <h3>Bondi Studios Online Gallery</h3>
> <table border="1" width="80%" cellpadding="2" cellspacing=
> "1" bgcolor="#999999">
> <tr bgcolor="#dedede">
> <th>Name</th>
> <th>Date</th>
> <th>Filename</th>
> <th>Thumbnail</th>
> <th>Medium</th>
> <th>Price</th>
> <th>Dimensions</th>
> </tr>
> <xsl:for-each select="Artwork">
> <tr bgcolor="#ffffff">
> <td><xsl:value-of select="Name"/></td>
> <td><xsl:value-of select="Date"/></td>
> <td><xsl:value-of select="Filename"/></td>
> <td><img src='<xsl:value-of select="Thumbnail"/>'</img></td>
> <td><xsl:value-of select="Medium"/></td>
> <td><xsl:value-of select="Price"/></td>
> <td><xsl:value-of select="Dimensions"/></td>
> </tr>
> <tr>
> <td height="128" width="96">
> <img src="Thumbnail"></img>
> </td>
> </tr>
> </xsl:for-each>
> </table>
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
>
>
gumshoe Guest



Reply With Quote

