Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


change website language dynamically using XML and XSL

From: Krassimir Valev <krassimir_valev@-----.--->
To: NULL
Date: 11/30/2007 9:37:00 PM
Hi.

I have the following problem. I want to apply different languages for
1 page, depending from a (by the user selected) parameter.
I have an index page (index.xml), which uses a xsl template. Let's
say, that the default language for this index page is english.. On the
page there are few flags with links to the same page (again
index.xml), but with a different language. Is there any way to do
this.

The easiest solution is to make a separate index page for all
languages (e.g. index_en.xml, index_ger.xml etc.) and specify the
language as an attribute. However I dont like this solution.

I tried passing parameters to the index page (e.g. index.xml?lang=en),
and then get the parameter with javascript. This didn't work out,
because when JS is ran, the HTML is already generated, and there is no
way to pass a variable from JS to XSL at this point.

Then I came up with another solution, but I have no idea, if this is
possible. Let's say that the index.xml has the following structute:
<?xml-stylesheet type="text/xsl" href="index.xsl"?>
<root lang="en" page="index">
  <index />
</root>

Is there any way to change the lang attribute somehow from the XSL
template?

Thanks in advance.


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