Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internationalization using XSL.. Help Plz

 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have an XML with UTF-8 data in it and want to display it on a web page. The Labels for the page are stored in a Resource Bundle. Can any one tell me how to retrieve the Labels from the Resource Bundle properties files into XSL for XML Rendering.

Thanks.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the Java based XSLT Processor has java extension, like XALAN or XT, you can read the labels files from XSLT using this extension tags.
Not sure whether this is a efficient way...better wait for somemore comments.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pervaiz,

There are a couple of things you can do:
1) use a helper class that creates a lokal XML file out of your resource bundle. You would need to run it only at deploy time. Then use document() in xlst to refere to it to pull the values.
2) In your code pull out the values from the resource bundle into a string that looks like xslt. Then transform your "real" xlst into a xlst that is language specific using the "string" from the resource bundle. (All in memory). Finally apply the xslt to your data
Hth
:-) stw
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stephen and Balaji for your help. I hope that works or I will have to revert to JSPs and complete parsing and object creation for this small task.



Regards,

Gul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic