xsl-list
[Top] [All Lists]

How can I create a variable with a variable access path?

2005-12-05 05:21:43

For an international application I'd like to store all texts in a
construct like

<xsl:variable name="AllTexts">
  <!-- german language texts -->
  <de>
    <searchButton>Suchen</searchButton>
    ...
  </de>
  <!-- english language texts -->
  <en>
    <searchButton>Search</searchButton>
  </en>
</xsl:variable>

When using these I would like to control the language with a parameter
like

<xsl:param name="language">de</xsl:param>

and access the strings like this

        <xsl:value-of select="$AllTexts/{$language}/searchButton"/>

However, for some reason xsl doesn't like me doing that.
Is there any easy way of making it work other than creating a complete
choose/when/ with static language selection?

Thanks for your help.

--
Ferdinand Soethe


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--