This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Problem with conditional parameter in call-template
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] Problem with conditional parameter in call-template
- From: Gavin Corfield <gavin at twobluedots dot com dot au>
- Date: Tue, 04 Sep 2001 10:10:09 +0800
- Organization: two blue dots
- References: <PKEMJDLDIDGFGAEMAACNAEFJCEAA.cfragoso@terra.es>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Carlos, if tipus is the only conditional parameter you can simplify
this by doing:
> <xsl:call-template name='entradaTexte'>
> <xsl:with-param name='id'>
> <xsl:value-of select='@id'/>
> </xsl:with-param>
> <xsl:with-param name='valor'>
> <xsl:value-of select='valor'/>
> </xsl:with-param>
> <xsl:with-param name='tipus'>
> <xsl:call-template name="set-tipus" />
> </xsl:with-param>
> </xsl:call-template>
>
<xsl:template name="set-tipus">
<xsl:choose>
<xsl:when test="name(.)='contraseyna'>password</xsl:when>
<xsl:otherwise>text</xsl:otherwise>
</xsl:choose>
</xsl:template>
then just add conditions as necessary.
hope that helps
gavin
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list