XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 16th, 2004, 02:11 PM
khwang's Avatar
khwang khwang is offline
Über nübe
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Babylon 4
Posts: 240 khwang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 27 sec
Reputation Power: 6
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...

Reply With Quote
  #2  
Old February 16th, 2004, 06:17 PM
MattSidesinger's Avatar
MattSidesinger MattSidesinger is offline
Java PHP Oracle Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: C-Bus OH-IO
Posts: 204 MattSidesinger User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 26 sec
Reputation Power: 5
Send a message via AIM to MattSidesinger
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.

Reply With Quote
  #3  
Old February 16th, 2004, 06:50 PM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 282 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 2 h 30 m 42 sec
Reputation Power: 6
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/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Multilingual support


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT