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

Re: assigning <xsl:param> to <xsl:template mode="$">??

Subject: Re: assigning <xsl:param> to <xsl:template mode="$">???
From: Dan Diebolt <dandiebolt@xxxxxxxxx>
Date: Fri, 20 Apr 2001 18:44:18 -0700 (PDT)
xsl template mode
name and mode in <xsl:template name="?" mode="?"> are QNames
name in <xsl:call-template name="?"> is a QName

So you have to supply a fixed name in both cases. If you want
a parameter/variable to determine what processing is done, you
are going to have to have some type of conditional in the body
of the template. I frequently put a variables at the top of
the style sheet that controls debug output for example. However, you
have to repeat the logic in every place you want the alternate
behavior:

<xsl:variable name="mode" select="'one'"/>
<xsl:template match="?">
  <part of template>
  <xsl:if test="f($mode)"><special processing></xsl:if>
  <more of template>
  <xsl:if test="f($mode)">)"><special processing></xsl:if>
  <more of template>
</xsl:template>

But this not necessary any worse than repeating the body of a 
template (with perhaps only minor changes) for each mode you 
might want to potentially invoke.

<xsl:template mode="one">
   <a lot of typing repeated in mode two/>
   <a little typing unique to mode one/>
</xsl:template>

<xsl:template mode="two">
   <a lot of typing repeated in mode one/>
   <a little typing unique to mode two/>
</xsl:template>

Regards,

Dan

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

 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.