Re: conditional processing in templates

Subject: Re: conditional processing in templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 22 Jul 1999 09:41:53 +0100 (BST)
> But this doesn't work because $label would be a side effect.

No it didn't work because you didn't pass the variable down to your

The action of this template

  <xsl:template mode="display" match="*[@type='date']">

depends on the value of the variable label, so you need to declare that
as a parameter to the template, so the template should begin

<xsl:param-variable name="label" exp="0"/>
<!-- default value optional, this is april syntax not July -->

then don't do this

 <xsl:variable name="label">1</xsl:variable>

do this

<xsl:apply-templates mode="display" select="First">
  <xsl:param name="label" expr="1"/>

actually rather than use 0 and 1 and have to test equality you could use
true and false.


 XSL-List info and archive:

Current Thread