This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Using mode to override templates
- From: "Hunsberger, Peter" <Peter dot Hunsberger at stjude dot org>
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 1 Jul 2002 10:02:24 -0500
- Subject: RE: [xsl] Using mode to override templates
- Reply-to: xsl-list at lists dot mulberrytech dot com
> 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:
<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:otherwise>
<xsl:apply-templates/> <!-- common templates -->
</xsl:otherwise>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list