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

RE: Using mode to override templates

Subject: RE: Using mode to override templates
From: "Hunsberger, Peter" <Peter.Hunsberger@xxxxxxxxxx>
Date: Tue, 2 Jul 2002 08:46:45 -0500
override template xslt
> For this to work I would need to replace all occurances of:
>
> <xsl:apply-templates/>
>
> with:
> 
> <xsl:choose>
>   <xsl:when test="$print = 'yes'">
>     <xsl:apply-templates mode="print"/>
>   </xsl:when>
>   <xsl:otherwise>
>     <xsl:apply-templates/>
>   </xsl:otherwise>
> </xsl:choose>

I've occasionally run into cases where I wished it was possible to specify a
list of modes on a template, something like mode="print | display". In any
case, the other possible way around this that may help in your case is to
have your specialized templates fire your more generic templates.  I've used
patterns like:

  <xsl:template match="gunk" mode="print">
	...
	<xsl:apply-templates select="." mode="generic"/>
	...
  </xsl:template>

Which causes the current node to get passed on to a more generic template
after some specific processing.  This may of course result in your being
required to add mode="generic" to many of your normal calls...



 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.