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: send 'with-param' determined by test


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


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