aspose file tools*
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
Author

Parsing a XML file containing japanese characters

Ramesh R G V S
Greenhorn

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(XMLParser.java
:1090)
at weblogic.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLErr
or(XMLDocumentScanner.java:673)
at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher
.dispatch(XMLDocumentScanner.java:1389)
at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocu
mentScanner.java:396)
at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:975)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:123)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:125)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:346)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:232)
at CreateParser.parse(CreateParser.java:63)
at SAXSample.main(SAXSample.java:22)

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

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
Greenhorn

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: http://aspose.com/file-tools
 
subject: Parsing a XML file containing japanese characters