Using an XSL with <img> tag

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default 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

  2. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139