xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] how to evaluate a dyna generated variable?


Subject: RE: [xsl] how to evaluate a dyna generated variable?
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Mon, 8 Sep 2003 10:13:23 +0100

> 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
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor