Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: change website language dynamically using XML and XSL

From: "TOUDIdel" <toudidel@----.-->
To: NULL
Date: 12/2/2007 10:32:00 AM


Uzytkownik "Krassimir Valev" <krassimir_valev@y...> napisal w 
wiadomosci 
news:3a894f84-9eea-4d03-84ac-a9c090a01f6e@d......
> 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.

in my opinion the better and simplier way (by the way with better 
performance) is performing xml files by server side scripts where you can 
read received parameters and use valid xslt template and transformation's 
result send back to client (as e.g. html or xml data, whatever)
-- 
td
XMLguru.net 




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