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

XSL and localization

Subject: XSL and localization
From: ar <armaillist@xxxxxxx>
Date: Wed, 06 Oct 2004 15:54:53 +0200
xsl localization
Hi all,

I want to introduce localization possibilities in my xsl transformations. To do that, I created a directory "locale" with a subdirectory for each lang "en", "es", "fr", "de" where I put xml files with translated text.
The information of the lang to use is in my data xml file.


To retrieve the good translation file, I use something like :

<xsl:variable name="labels" select="document(concat('locale/', /*/@lang,'/test_locale.xml'))//label" />

To retrieve a label I use :
  <xsl:value-of select="$labels[@id='ALabelId']"/>


My problem is when the translation file doesn't exist. I'd like to choose a default file in this case :


If in my data file the "lang" parameter = "fr" then use the labels in file locale/fr/test_locale.xml. If this file doesn't exist, I want to use the file locale/en/test_locale.xml.

Is this possible and how ?

Is there a better way to implement localization ?


-- A. ROY

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.