[thelist] Avoid the CDATA dance in XSL

Nik Schramm n at industriality.com
Fri May 31 06:13:01 CDT 2002


Shane,

try this

<xsl:element name="a">
	<xsl:attribute name="title">Your link title here</xsl:attribute>
	<xsl:attribute name="href">?op=show&uid=<xsl:value-of
select="@uid" /></xsl:attribute>
	<xsl:attribute name="class">Your css class here</xsl:attribute>
		<xsl:value-of select="."/>
</xsl:element>

N.B. I couldn't figure out what exactly <xsl:value-of select="uid" /> is
supposed to be in your code: an attribute, a child tag ? I assumed it
was an attribute and added the '@', if it isn't, use the appropriate
Xpath expression to suit.

/nik

www.industriality.com - candy for the inner eye


>>-----Original Message-----
>>From: thelist-admin at lists.evolt.org
>>[mailto:thelist-admin at lists.evolt.org] On Behalf Of shane - iordy.com
>>Sent: Friday, May 31, 2002 11:52
>>To: thelist at lists.evolt.org
>>Subject: [thelist] Avoid the CDATA dance in XSL
>>
>>
>>[ Converted text/html to text/plain ]
>>I'm new to XSL and I would like to know if I can avoid doing
>>the CDATA dance
>>(shown below) in my XSL template just to add a link like
>>
>>URL:
>><a href="?op=show&uid=1>alias</a>
>>
>>CDATA DANCE:
>><![CDATA[<a href="?op=info&id=]]><xsl:value-of select="uid"
>>/><![CDATA[">]]><xsl:value-of
>>select="alias" /><![CDATA[</a>]]>
>>
>>
>>--
>>shane - iordy.com, iordy at iordy.com on 05/31/2002
>>--
>>For unsubscribe and other options, including
>>the Tip Harvester and archive of thelist go to:
>>http://lists.evolt.org Workers of the Web, evolt !
>>




More information about the thelist mailing list