[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: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Tue, 2 Jul 2002 11:45:02 +0100
xsl override template
Joerg:
>What about replacing all occurances of
>
><xsl:apply-templates/>
>
with
>
><xsl:apply-templates select="." mode="choose"/>


nice one Joerg, thats what I was looking for ;)

cheers
andrew




-----Original Message-----
From: Joerg Heinicke [mailto:joerg.heinicke@xxxxxx]
Sent: 02 July 2002 10:04
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Using mode to override templates


What about replacing all occurances of

<xsl:apply-templates/>

with

<xsl:apply-templates select="." mode="choose"/>

and add a template

<xsl:template match="*" mode="choose">
   <xsl:choose>
     <xsl:when test="$print = 'yes'">
       <xsl:apply-templates mode="print"/>
     </xsl:when>
     <xsl:otherwise>
       <xsl:apply-templates/>
     </xsl:otherwise>
   </xsl:choose>
</xsl:template>

Should work ;-)

Regards,

Joerg


Andrew Welch wrote:
> Peter,
> 
> 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>
> 
> Not such a big deal I suppose, especially if I isolate all the cases
> where a call to a print template is possible.  
> 
> I guess I was just hoping for some kind of workaround.
> 
> cheers
> andrew


-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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





---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
 

 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.