www.webdeveloper.com
Results 1 to 2 of 2

Thread: XSL - Displaying an Image, Filename is in the XML

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    FLIARDO
    Posts
    4

    XSL - Displaying an Image, Filename is in the XML

    To Whom...
    This is my very first example to get a feel for XSLT: inside of the xml as an elements value, I have a filename.
    Code:
    ...
    <filename>item1.jpg</filename>
    ...
    inside of my xsl I have tried to simply display the image as follows.
    Code:
    ...
    <img src='<xsl:value-of select="filename" />' />
    ...
    I have tried many other ways that seemed obvious, but I have had no luck...
    Can somebody let me know how this seemingly simple task will work.
    Merry Christmas AND/OR Happy Holidays.

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    Code:
    <img>
        <xsl:attribute name="alt">
            <xsl:value-of select="alt-text"/>
        </xsl:attribute>
        <xsl:attribute name="src">
            <xsl:value-of select="filename"/>
        </xsl:attribute>    
    </img>
    Or something like that.

    And a "Bah, Humbug!" to you.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles