Subject: Re: [xsl] mode computation case From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 03 Sep 2010 09:21:47 +0100 |
<xsl:template name="dispatch"> ... <xsl:choose> <xsl:when test="@mode eq 'mode1'"><xsl:apply-templates select="$nodetree" mode="mode1"></xsl:when <xsl:when test="@mode eq 'mode2'"><xsl:apply-templates select="$nodetree" mode="mode2"></xsl:when <xsl:when test="@mode eq 'mode3'"><xsl:apply-templates select="$nodetree" mode="mode3"></xsl:when <xsl:when test="@mode eq 'mode4'"><xsl:apply-templates select="$nodetree" mode="mode4"></xsl:when <xsl:when test="@mode eq 'mode5'"><xsl:apply-templates select="$nodetree" mode="mode5"></xsl:when <xsl:when test="@mode eq 'mode6'"><xsl:apply-templates select="$nodetree" mode="mode6"></xsl:when <xsl:otherwise><xsl:apply-templates select="$nodetree" mode="modeX"></xsl:otherwise> </xsl:choose ... <xsl:template>
Which already looks better, mostly since all modes in this example share the same tunneled parameters. The xsl:choose in "dispatch" is still somewhat clunky and an additional template is required. Therefore, I still propose that mode be made computable.
Regards, ac
replace xsl:call-template name="dispatch"> by <xsl:apply-templates select="@mode">
<xsl:template match="@mode[.='mode5']"> <xsl;param name="nodetree" tunnel="yes"/> <xsl:apply-templates select="$nodetree" mode="mode5"/> </xsl:template>
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] mode computation case, ac | Thread | [xsl] tokenize function behaviour, Bartolomeo Nicolotti |
Re: [xsl] Converting from <dt><dd> , Imsieke, Gerrit, le- | Date | Re: [xsl] Moving elements during id, Martynas Jusevicius |
Month |