[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Variables and the mode attribute in apply-template
Hi Ben, I do not think it is possible to do what you are trying. I usualy only do tests on attributes or node values in the context, but perhaps something like this will work for you? <xsl:variable name="Layout" select="/content/layout/node()"/> <xsl:template match="SomeTemplate"> <xsl:apply-templates select="xxx"/> </xsl:template> <xsl:template match="xxx[$Layout='OneLayout']"> <!-- Do something with this one --> </xsl:template> <xsl:template match="xxx[$Layout='AnotherLayout']"> <!-- Do something with this other one --> </xsl:template> Regards, Ragulf Pickaxe :-) On 11/3/05, ben senior <ben@xxxxxxxxxxxxx> wrote: > I wish to decide between calling one of a set of templates depending on > a fragment of xml (/content/layout/node()). > > Rather than having a mass of xsl:when/choose statements, I thought I > would add : > > <xsl:apply-templates select="xxx" mode="{/content/layout/node()}"/>
|
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
|