RE: [xsl] Using mode to override templates

Subject: RE: [xsl] Using mode to override templates
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Mon, 1 Jul 2002 10:25:09 -0500
>> Obviously, apply-templates with a mode will only use templates with a
>> matching mode (and not fire all the templates that are common to both
>> and therefore would not have a mode) - how do I overcome this?
>
> Andrew,
> how about just making the non print templates and the common code
explicit?
> IE:

Arg, correction, the otherwise isn't needed; that code should always be
fired...

  <xsl:choose>
   <xsl:when test="$print = 'yes'">
     <xsl:apply-templates mode="print"/>
   </xsl:when>
   <xsl:when test="$print != 'yes'">
     <xsl:apply-templates mode="not_print"/>
   </xsl:when>
 </xsl:choose>
 <xsl:apply-templates/>	<!-- common templates -->


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


Current Thread