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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format