DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Patrick Long Guest

    XSL and HTML attributes

    I am trying to write the following tranformation:

    <p><img src="<xsl:value-of select="Filename"/>.gif"></p>

    When I load the xsl into IE5.5 to check if it is well formed the following
    error occurs:
    The character '<' cannot be used in an attribute value. Line 11, Position 17

    <p><img src="<xsl:value-of select="Filename"/>.gif"></p>
    ----------------^

    Any ideas on how to solve this gratefully received.

    Thanks

    Pat Long



  2. #2
    Russell Jones Guest

    Re: XSL and HTML attributes

    Either of these will work:

    Try this: <p><img src="{Filename}.gif"/></p>

    Or this:

    <p><img><xsl:attribute name="src"><xsl:value-of
    select="Filename"/>.gif"</xsl:attribute></img></p>

    Russell Jones
    Sr. Web Development Editor,
    DevX.com

    "Patrick Long" <Patrick_long@csi.com> wrote in message
    news:3b1f4127$1@news.devx.com...
    > I am trying to write the following tranformation:
    >
    > <p><img src="<xsl:value-of select="Filename"/>.gif"></p>
    >
    > When I load the xsl into IE5.5 to check if it is well formed the following
    > error occurs:
    > The character '<' cannot be used in an attribute value. Line 11, Position

    17
    >
    > <p><img src="<xsl:value-of select="Filename"/>.gif"></p>
    > ----------------^
    >
    > Any ideas on how to solve this gratefully received.
    >
    > Thanks
    >
    > Pat Long
    >
    >




  3. #3
    David Guest

    Re: XSL and HTML attributes


    I always do as follows:

    <xsl:element name="IMG">
    <xsl:attribute name="src"><xsl:value-of select="Filename"/>.gif
    </xsl:attribute>
    </xsl:element>

    cu.
    David

    "Patrick Long" <Patrick_long@csi.com> wrote:
    >I am trying to write the following tranformation:
    >
    ><p><img src="<xsl:value-of select="Filename"/>.gif"></p>
    >
    >When I load the xsl into IE5.5 to check if it is well formed the following
    >error occurs:
    >The character '<' cannot be used in an attribute value. Line 11, Position

    17
    >
    > <p><img src="<xsl:value-of select="Filename"/>.gif"></p>
    >----------------^
    >
    >Any ideas on how to solve this gratefully received.
    >
    >Thanks
    >
    >Pat Long
    >
    >



Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links