[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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)
Re: conditional processing in templates
> 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
template.

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"/>
</xsl:apply-templates>

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

David


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.