Re: [xsl] send 'with-param' determined by test

Subject: Re: [xsl] send 'with-param' determined by test
From: "Swen Thuemmler" <Swen.Thuemmler@xxxxxxxxxxxx>
Date: Mon, 7 May 2001 08:52:05 +0200 (CEST)
On Mon, 7 May 2001, Tim Watts wrote:

[...] 

> I have included the code below.
> 
> <xsl:call-template name="date-stripper">
>      <xsl:choose>
>           <xsl:when test="/document/transient/param[@name = 'from-year']">
>                <xsl:with-param name="start-date-year"
> select="/document/transient/param[@name = 'from-year']" />
>           </xsl:when>
>           <xsl:otherwise>
>                <xsl:with-param name="start-date-year"
> select="/document/data/merchant/start-date/@year" />
>            </xsl:otherwise>
>      </xsl:choose>

You have the ordering wrong. Try:

<xsl:call-template name="date-stripper">
  <xsl:with-param name="start-date-year">
    <xsl:choose>
      <xsl:when test="/document/transient/param[@name = 'from-year']">
        <xsl:value-of select="/document/transient/param[@name = 'from-year']" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="/document/data/merchant/start-date/@year" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:with-param>
</xsl:call-template>


Greetings, Swen



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread