RE: XSL bracket nested in HTML a tag

Subject: RE: XSL bracket nested in HTML a tag
From: "Christopher R. Maden" <crism@xxxxxxxxxx>
Date: Thu, 31 Aug 2000 11:27:10 -0700
At 17:27 31-08-2000 +0200, Thorbjørn Ravn Andersen wrote:

> I'm using an XSL parameter :  <xsl:param
> name="server">www.hp.com</xsl:param>
> so, in my XSL file, I want to use :
> <a HREF="http://<xsl:value-of select="$server">">, but guess
> what... It
> doesn't work!
> the parser does not accept bracket within tag.
> Has anybody an idea about how to solve this pb?

You must construct the attribute via the <xsl:attribute> tag to do this.

Or use an attribute value template (AVT).


With xsl:attribute:
<a>
  <xsl:attribute name="href">
    <xsl:text>http://</xsl:text>
    <xsl:value-of select="$server">
  </xsl:attribute>
  <!-- content of <a> -->
</a>

With an AVT:
<a href="http://{$server}";><!-- content of <a> --></a>

-Chris
--
Christopher R. Maden, Senior XML Analyst, Lexica LLC
222 Kearny St., Ste. 202, San Francisco, CA 94108-4510
+1.415.901.3631 tel./+1.415.477.3619 fax
<URL:http://www.lexica.net/> <URL:http://www.oreilly.com/%7Ecrism/>


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



Current Thread