Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: tool for managing XSL variables in different languages? [Thread Next] Re: tool for managing XSL variables in different languages?To: NULL Date: 9/2/2004 12:53:00 PM for "de" it's: <xsl:variable name="text.greetings" select="'Benutzername'" /> <b><xsl:value-of select="$text.greetings" /></b> that means you have to modify the XSL for each language, and can't easily be extended to support more than one language at a time (eg the current language from an xml:lang attribute in the source file) If instead your language config file was more like <text name="greetings"> <x lang="en">Greetings</x> <x lang="de">Benutzername</x> </text> ... then instead of going <xsl:value-of select="$text.greetings" /> you'd go <xsl:value-of select="$lang-config/text[@name='greetings']/x[@lang='de']" /> here you can eaily replace 'de' by for example ancestor-or-self::*[@xml:lang][1]/@xml:lang which gets the in scope xml:lang attribute, or have some xsl code to provide a fall back or warning message if the language specific text is absent. David | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
