Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XML, XSL & i18n

2 views
Skip to first unread message

Michael Engelhart

unread,
Jan 14, 2000, 3:00:00 AM1/14/00
to
I currently have an Java servlet application that I'm moving to Cocoon. This
application uses the servlet API's getLocale() method to figure out what
language to display the page in. I use ResourceBundles to store my language
information and everything works using JSP/Servlet combination. My question
is how would I do this with XML/XSL. I have tried a lame hack where I put a
<MESSAGE></MESSAGE> element in my XML but this defeats the point of
separating data from style. The messages don't have anything to do with
the data, mostly just HTML labels for fields, etc. Any ideas on how to go
about this. Does XSL allow some kind of programmatic transformation along
the lines of ResourceBundles? if not does anyone have any ideas on a good
way to go about handling this?

Thanks,

Mike


Michael Claßen

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to
Michael,
maybe you can make use of the xml:lang attribute?
If you have one big message file and tag every message with that attribute
and the respective value you can then pull them out with XPath
"@xml:lang=de" using XSLT, one would think.
You can do the same as resource bundles by splitting up the messages in
different files and conditionally including them depending on the client
request language.
Not sure if this fits your context, hope it helps
Michael
http://exploringxml.com

Michael Engelhart <menge...@earthtrip.com> wrote in message
news:B4A4C655.68D%menge...@earthtrip.com...

0 new messages