[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: assigning <xsl:param> to <xsl:template mode="$">??
Hi Dan, thanks for this advice. I understood. I will follow your suggestion and use conditional processing. Regards, Arne > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Dan Diebolt > Sent: Saturday, April 21, 2001 3:44 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: assigning <xsl:param> to <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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|