[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Inserting URL info from XML element into XSL templ

Subject: Re: Inserting URL info from XML element into XSL template
From: "John Bennett" <john@xxxxxxxxxxxxx>
Date: Thu, 2 Aug 2001 09:02:59 -0400
xsl img url
Two options:

1. Use a variable and an attribute value template:
<xsl:variable name="filename" select="img/text()"/>
<img scr="images/{$filename}" />

2. Use xsl:attribute with xsl:value-of:
<img>
    <xsl:attribute name="src">images/<xsl:value-of
select="img"/></xsl:attribute>
</img>


------------------------------------------------------------
John Bennett
john@xxxxxxxxxxxxx


----- Original Message -----
From: "Armin Fabritius" <ghostrider@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, August 02, 2001 8:43 AM
Subject:  Inserting URL info from XML element into XSL template


> Hi all,
>
> I have the following problem concerning variable URLs in XSL:
>
> I have an XML file which contains:
>
> <product>
> <description></description>
> <img>easyrider.jpg</img>
> </product>
>
> The <img> element's content is the filename of the image for the
product.
> I want the image to show in the HTML output, so my HTML code has to
look like
> this:
>
> <img scr="images/easyrider.jpg">
>
> I tried to this within the template for each product:
>
> <img scr="images/<xsl:value-of select="img" />" />
>
> but of course this is bad syntax. How can I get this to work?
> All help is appreciated here, so...
>
> Thanks in advance,
>
> Armin
>
>
>  XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.