|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Multilingual support
I would like to support multiple languages in my stylesheet (e.g. detect which language the user's browser is set to). Can I do this with XSLT, and without JavaScript?
__________________
Hello, old friend... |
|
#2
|
||||
|
||||
|
No.
Since the XSL spec was written so that there was no dependency upon a browser, all you need is a transformer. There are no functions within XSL that will give you anybrowswer information. It is true that some browsers have the ability to do XSL transformations. Even if a certain browser did go against the spec and create a function that would get browser information, it would not be able to run in any of the other browsers. To my knowledge no browser has any XSL function that will return the information you want. You can add JavaScript to an XSL document. Now whether or not that JavaScript can get the information you want, I don't know. But you said you wanted to know if there was a way w/o JS, so I won't continue to ramble down this path. Someone let me know if I took a wrong turn. |
|
#3
|
|||
|
|||
|
The easiest approach is to pass in the locale as a parameter
to your stylesheet and handle the various locale differences via xsl:if or xsl:choose tests. Also this article on the subject is worth reading: www-106.ibm.com/developerworks/library/wa-xslt/ |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Multilingual support |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|