This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with conditional parameter in call-template


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]