Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: tool for managing XSL variables in different languages?

From: David Carlisle <davidc@---.--.-->
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent