[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

Subject: Re: Variables and the mode attribute in apply-templates
From: Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx>
Date: Thu, 3 Nov 2005 15:46:53 +0100
xsl mode variable
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()}"/>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.