XSL and HTML attributes


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: XSL and HTML attributes

  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
    >
    >



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center