This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Internationalization using XSL.. Help Plz Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Internationalization using XSL.. Help Plz" Watch "Internationalization using XSL.. Help Plz" New topic

Internationalization using XSL.. Help Plz

Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
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.

Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
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.

Spritle Software Blogs
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
:-) stw
Gul Khan
Ranch Hand

Joined: Sep 03, 2003
Posts: 173
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.


I agree. Here's the link:
subject: Internationalization using XSL.. Help Plz
It's not a secret anymore!