XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Marc PidouxSubject: ASP & XML?
Author: Marc Pidoux
Date: 05 Oct 2005 07:30 PM
On my XSL document, I am trying to generate dynamic path to differant images through a loop.

I am basically trying to do this, but it doesn't work of course:

<xsl:for-each select="rss/channel/item/yweather:forecast">
<xsl:value-of select="@day"/>:
<img src="/img/ <xsl:value-of select='@code'/> .gif>
</xsl:for-each>

I want at the end to end up with something like:
Monday: <img src="/img/good.gif" />
Tuesday: <img src="/img/fair.gif" />

etc...

Thanks!

Posttop
(Deleted User) Subject: ASP & XML?
Author: (Deleted User)
Date: 06 Oct 2005 01:21 PM
Try something like this:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table width="100%" border="1">
<xsl:for-each select="rss/channel/item/forecast">
<tr>
<td>
<xsl:value-of select="@day"/>
</td>
<td>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="@code"/>.gif</xsl:attribute>
</xsl:element>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.