RE: [xsl] assigning <xsl:param> to <xsl:template mode="$">???

Subject: RE: [xsl] assigning <xsl:param> to <xsl:template mode="$">???
From: "Arne Borkowski \(\)" <arne@xxxxxxxxx>
Date: Sat, 21 Apr 2001 23:03:38 +0200
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: [xsl] 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
>  XSL-List info and archive:

 XSL-List info and archive:

Current Thread