• Post Reply Bookmark Topic Watch Topic
  • New Topic

Parsing a XML file containing japanese characters  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!