Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - using xsl:value-of inside of img tag >Thread Next - Re: using xsl:value-of inside of img tag Re: using xsl:value-of inside of img tagTo: NULL Date: 8/3/2004 6:50:00 PM Tim Collinson wrote:
> This is probably a simple thing but I can't seem to find the answer for it
> anywhere. I have an .xml file with a tag somewhat like the one below:
>
> <article_pic>www.somewhere.com/pic.jpg</article_pic>
>
> I then have an .xsl file I am building to display the data in the .xml file.
> In the .xsl file I have a line something like this:
>
> <img src ="<xsl:value-of select="home/main_article/article_pic" />" align
> ="left" />
Try using an attribute value template:
<img src ="{home/main_article/article_pic}" align="left" />
A more generic approach is something like
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="home/main_article/article_pic"/>
</xsl:attribute>
</xsl:element>
(untested)
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
