aspose file tools*
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Internationalization using XSL.. Help Plz" Watch "Internationalization using XSL.. Help Plz" New topic
Author

Internationalization using XSL.. Help Plz

Gul Khan
Ranch Hand

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

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
Anonymous
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
Hth
:-) 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.



Regards,

Gul
 
 
subject: Internationalization using XSL.. Help Plz