How to select a locale for parser error messages

Does anybody know how I can select a locale for parser error messages? I found org.xml.sax.Parser.setLocale, but that's for SAX1 and deprecated.

I have a textarea in the user interface where a user can edit XML and, of course, I'd like the parsing error messages to appear in the selected locale...

Any help appreciated.

- Michael

[358 byte] By [MNLippa] at [2007-10-3 4:30:55]
«« rmi
»» C++ with java
# 1
There's a big assumption in that question, namely that the error messages that the parsers produce have actually been internationalized.
DrClapa at 2007-7-14 22:34:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Considering SAX1, they obviously used to. And I know Xerces does it, but I'd like to avoid using the Xerces native API.
MNLippa at 2007-7-14 22:34:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
I did a test in which this line was executed before the parse:Locale.setDefault(Locale.FRANCE);and the error message I got was this:org.xml.sax.SAXParseException: "</a>" pr関u pour terminer l閘閙ent qui commence ?la ligne {1}.
DrClapa at 2007-7-14 22:34:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Yes, but doing this you changed the locale for the JVM! My context is a servlet container running the request from different clients with different locales concurrently! So this is a no-go.
MNLippa at 2007-7-14 22:34:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5

> Yes, but doing this you changed the locale for the JVM!

I know that. My intention was to see whether the parsers even had error messages in languages other than English. If they didn't then there would be no point in proceeding. But they do, so maybe there is some point.

However you don't get to specify the locale for exceptions thrown by other Java classes, so I wouldn't be surprised to find you don't get to specify the locale for exceptions thrown by XML parsers. I'm not saying there is no way to do that, only that I would not be surprised if there were no way.

DrClapa at 2007-7-14 22:34:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...