[thelist] XSL: current node question

Peter-Paul Koch gassinaumasis at hotmail.com
Fri Mar 30 14:21:22 CST 2001




>I want them all to be treated equally, by a template like the following:
>
>	<xsl:template match="anne|betty|cindy">
>		<div class="...">
>			[more stuff in here]
>		</div>
>	</xsl:template>
>
>what do I do if I want the class on that <div> to be anne, or betty, or
>cindy, depending on the context?

Try

<div>
<xsl:attribute name="class">
<xsl:eval>
self.tagName
</xsl:eval>
</xsl:attribute>
[more stuff]

The self.tagName bit assumes that the normal JavaScript W3C DOM works inside 
an xsl sheet in IE5. If it doesn't, try to find the property you need at 
MSDN.

BTW: Long time ago I wrote a test XSL sheet: http://www.netlinq.nl/interest/ 
Maybe it'll help you. (IE5 required)

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





More information about the thelist mailing list