This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: apply-templates with a variable mode
- From: "James Fuller" <james dot fuller at o-idev dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 27 Jun 2002 12:50:39 +0100
- Subject: Re: [xsl] apply-templates with a variable mode
- Organization: o-iDeveloper ltd.
- References: <019e01c21dcb$3d4bf570$15c809c6@PCJOERI01>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Joeri,
u could use
<xsl:template match="masterpattern">
<xsl:choose>
<xsl:when test="some test">
<xsl:apply-templates select="." mode="style1"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="style2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and quess what i found it at the XSLT FAQ www.dpawson.co.uk , under modes.
cheers, jim fuller
----- Original Message -----
From: "Joeri Belis" <joeri.belis@nollekens.be>
To: <xsl-list@lists.mulberrytech.com>
Sent: Thursday, June 27, 2002 12:10 PM
Subject: [xsl] apply-templates with a variable mode
> Hi,
>
> Can i have a mode attribute of apply-templates and set it from a variable?
> What i tried so far has resulted in an error.
>
> <xsl:template match="root" mode="filter">
> <xsl:param name="filtermode"/>
>
> <xsl:apply-templates select="offre" mode="$filtermode"/>
>
> </xsl:copy>
> </xsl:template>
>
> Error on line 39 of file:/C:/temp/filter_off.xsl:
> Mode name is not a valid QName
> Transformation failed
>
> Thank you,
> Joeri
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list