File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Product and Other Certifications and the fly likes Parsing a XML file containing japanese characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "Parsing a XML file containing japanese characters" Watch "Parsing a XML file containing japanese characters" New topic

Parsing a XML file containing japanese characters

Ramesh R G V S

Joined: Apr 20, 2002
Posts: 18
Hi All
I am triyng to parse a XML file whoose data contains some japanece characters.when i try to parse and get the data out of it its giving the following exception.
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0xa5) was foun
d in the element content of the document.
at weblogic.apache.xerces.framework.XMLParser.reportError(
at weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLErr
at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocu
at weblogic.apache.xerces.framework.XMLParser.parse(
at weblogic.xml.jaxp.WebLogicXMLReader.parse(
at weblogic.xml.jaxp.RegistryXMLReader.parse(
at javax.xml.parsers.SAXParser.parse(
at javax.xml.parsers.SAXParser.parse(
at CreateParser.parse(
at SAXSample.main(

Can anybody suggest me a solution on how to handle japance characters in XML files.
I am using xerces parser.
John Wetherbie

Joined: Apr 05, 2000
Posts: 1449
Found this using Google. Hopefully it will point you in the right direction. This seems to lay out what encodings are used by Xerces.
[ May 21, 2003: Message edited by: John Wetherbie ]

The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
Karthik Jayaraman

Joined: May 06, 2003
Posts: 25
I dont think you can have multiple encoded charaters in a single xml document. If you need the japanese characters, they must be included as an external entity with an encoding attribute for the xml declaration in the external file.

Karthik Jayaraman.<br />IBM Certified Developer - XML and Related Technologies.<br />Sun Certified Developer for java WebServices.<br />Sun Certified Java Programmer.
I agree. Here's the link:
subject: Parsing a XML file containing japanese characters
It's not a secret anymore!