[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: how to evaluate a dyna generated variable?

Subject: RE: how to evaluate a dyna generated variable?
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Mon, 8 Sep 2003 10:13:23 +0100
generated variable name
> Hello,
>   I have defined the I18n resources with variables like this:
> <xsl:variable name="lang.type.participant.1" select="'Absolute
> Relation'"/>
> <xsl:variable name="lang.type.participant.2" select="'Relative
> Relation'"/>
> <xsl:variable name="lang.type.participant.3" select="'Group
Expression'"/>
> 
> and in my stylesheet, I want to get the resource like this:
> <xsl:value-of
> select="exsl:evaluate(concat('$lang.type.participant.',Type))">
> but it seems exsl:evaluate only accept variables that contain XPath
> reference,right? then is there any way to do this?

Do it all in a xsl:choose/xsl:when in a named template, then call that
template each time passing in the type as a param:

<xsl:call-template name="lang.type">
  <xsl:with-param name="type" select="Type"/>
</xsl:call-template>

It's fine if you have limited set of variables, if they are endless you
may want to consider generating the stylesheet.

cheers
andrew

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.