Re: [xsl] computed <xsl:apply-templates mode=

Subject: Re: [xsl] computed <xsl:apply-templates mode=
From: robert frapples <oyenstikker@xxxxxxxxx>
Date: Thu, 9 Dec 2004 07:35:52 -0500
> Does something as mundane as this work:
> 
> <xsl:choose>
>   <xsl:when test="$variable = 'foo'">
>     <xsl:apply-templates mode="foo"/>
>   </xsl:when>
>   <xsl:when test="$variable = 'bar'">
>     <xsl:apply-templates mode="bar"/>
>   </xsl:when>
>   <!-- etc. -->
>   <xsl:otherwise>
>     <xsl:message>Invalid variable: <xsl:value-of select="$variable"/>
> </xsl:message>
>   </xsl:otherwise>
> </xsl:choose>

That would work, but there are several dozen options, and it would get
tedious.  I ended up abandoning modes and matching the templates to
the attribute of the element.

Current Thread