cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Staub" <>
Subject RE: setting attributes in xsl
Date Wed, 16 Aug 2000 20:19:42 GMT

Get a book on XSLT!

In this case, you want to use <xsl:attribute>.

-Ed Staub

-----Original Message-----
From: Matthew Smith []
Sent: Wednesday, August 16, 2000 4:06 PM
To: Cocoon List (E-mail)
Subject: setting attributes in xsl

	How can I set an atribute in xsl?  Here's an example.. I know this is a
silly example, but I can't really think of a ood one right now and it
illustrates the idea.

<xsl:template match="link">
   <a href="<xsl:value-of select="@url">"><xsl:value-of select="link"></a>

	Obviously this doesn't work.  Attributes can't contain html tags.  The only
solution I've seen is:

<xsl:template match="link">
   <xsl:variable name="url"><xsl:value-of select="@url"></xsl:variable>
   <a href="{$url}"><xsl:value-of select="link"></a>

	Is this the way it must be done, or is there a more graceful solution?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message