Re: [xsl] passing xsl:value-of to HREF

Subject: Re: [xsl] passing xsl:value-of to HREF
From: Peter Finch <peter@xxxxxxxxxxx>
Date: Tue, 07 Jan 2003 01:08:48 +1100
Hi Lee,

Hi, in my XSL, I need to pass a value from XML to "href", but int complains about "<", how would handle this? THanks <tr> <td align="right"><a href="http://myserver.com:8881/sp/xmlReport?contentType=excel&amp;reportType =rates&amp;FUND=<xsl:value-of select="TIME_ZONE">"><img src="/fd/images/bottom_nav_download.gif" width="157" height="21" border="0"/></a></td> </tr>

If the source XML document is valid then the "<" and ">" must be entities "&lt;" and "&gt;" even when in an attribute.

<row url="...&lt;...&gt;">

The value can be loaded into the <a> tag as normal and the rest
will just work.

<xsl:template match="row">
 <a href="{@url}">
  ...
 </a>
</xsl:template>

I hope this helps.
Peter



--
   ___
  (OvO)
  /:::\
  \|:|/
/--m-m--------------------------------+
| Peter Finch (p.finch@xxxxxxxxxxx)   |
| Home Planet Software                |
| http://www.homepla.net/             |
/-------------------------------------/




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



Current Thread