cocoon-users mailing list archives

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

Get a book on XSLT!

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

-Ed Staub

-----Original Message-----
From: Matthew Smith [mailto:msmith@windebt.com]
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>
</xsl:template>

	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>
</xsl:template>

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

Thanks,
Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message