Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-27-2009, 12:45 PM
Member
 
Join Date: Oct 2009
Posts: 2
Rep Power: 0
k0k33 is on a distinguished road
Default Changing the Locale language for the XML validation
Hi, all!
the problem is like this:
I have to validate an XML message, using

javax.xml.validation.Schema;
javax.xml.validation.SchemaFactory;
javax.xml.validation.Validator;

But after validation, I get the error message in the Locale default language. I don't want to change the JVM language. Is there any way to change the language just for the validation process, without re-setting the defaultLocale?

Thanks for the replies!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-17-2009, 11:10 AM
Member
 
Join Date: Oct 2009
Posts: 2
Rep Power: 0
k0k33 is on a distinguished road
Default
After almost 14 days, I came to the solution - if you want to change the Locale language of the validation output, there is no simple way to set it, using the javax.xml.validation library. So, if you really need to validate your XML messages this way, I bid to you good luck in changing the .class files. My solution was rather different - i didn't need to validate the messages that way, so I chose a different way - I used the org.apache.xerces SAXparser, which has a settable Locale. But mind you, that if you set your locale to any english speaking language(Canadian, US, UK,...) your Locale will remain the same as your default one. So, if you want to get the output in english, you ned to set the parser locale to Locale.ROOT. That will return in english!

Hope anyone finds this useful in the future!
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to do to change from a language to an other language? Ravanelly New To Java 5 08-25-2009 10:41 AM
Locale with SimpleDateFormat swati.jyoti New To Java 4 07-02-2009 03:34 PM
Locale example Java Tip Java Tips 0 01-29-2008 10:04 AM
How ro change the locale of JVM ravi.ks007@hotmail.com Advanced Java 2 12-26-2007 07:17 AM
Locale Java Tip Java Tips 0 11-16-2007 03:16 PM


All times are GMT +2. The time now is 02:46 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org