This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Show - hide with xslt?
- To: xsl-list at mulberrytech dot com
- Subject: Re: Show - hide with xslt?
- From: David Allouche <david at ansible dot xlii dot org>
- Date: Fri, 25 Aug 2000 11:41:21 -0200 (GMT+2)
- Reply-To: xsl-list at mulberrytech dot com
On Thu, 24 Aug 2000, Andrea Penna wrote:
> <xsl:variable name="my_id"><xsl:value-of select="generate-id()"/>
> </xsl:variable>
>
> <div style="display:none">
> <xsl:attribute name="id"><xsl:value-of
> select="$my_id"/></xsl:attribute>
[...]
> </div>
>
> <a>
> <xsl:attribute name="href">javascript:showhide('<xsl:value-of
> select="$my_id"/>');</xsl:attribute>
[...]
> </a>
As usual, you can write it far more simpler and cleaner (to my sense)
using attribute value templates...
<xsl:variable name="my-id" select="generate-id()"/>
<div style="display:none" id="{$my-id}">
[...]
</div>
<a href="javascript:showhide('{$my-id}');">
[...]
</a>
Hope this helps.
-- David --
PS: thanks for the JavaScript snippet, I've been looking for a way of
doing this for a long time, but I'm completely clueless about all the
JavaScript and DOM voodoo needed.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list