Re: Paramters in templates

Subject: Re: Paramters in templates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 23 Jul 1999 09:06:27 +0100 (BST)
> In the style sheet I'm working on I having to add the param support in
> hundreds of places to make sure it keeps getting passed down. This has
> doubled the size of my stylesheet and made it hard to read.

If carying the information down the tree is too much effort, it may be
simpler to leave it at the top, and just send back for it when you need

ie rather than

<xsl:template match="A">
  <xsl:param name="label" expr="true"/>

<xsl:template match="B">
  <xsl:param name="label" expr="false"/>

and then all templates explicitly handling a parameter $label,
you can do

<xsl:template match="A|B">

and then, when in the first version you actually used $label, rather
than just passing it on, now  go

  <xsl:if test="from-ancestors-or-self(A)">


 XSL-List info and archive:

Current Thread