This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: problem in using * as a default parameter in xsl:param
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 29 Apr 2002 17:08:46 +0100
- Subject: RE: [xsl] problem in using * as a default parameter in xsl:param
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> this is what i did:
>
> <xsl:param name="param1" select="*"/>
> ....
> <xsl:for-each select="elementName[childName=$param1]">
> <xsl:copy-of select="elementName"/>
> </xsl:for-each>
> ...
>
You're straying into dynamic XPath expressions here. If you don't want to
use the xx:evaluate() extension, you can do:
<xsl:param name="childElement" select="'*'"/>
<xsl:for-each
select="element[$childElement!='*][childName=$childElement] |
element[$childElement='*']">
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list