Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - change website language dynamically using XML and XSL [Thread Next] Re: change website language dynamically using XML and XSLTo: 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
