Solved

XML parsing error(Encoing type)

Posted on 2001-07-02
2
687 Views
Last Modified: 2013-11-23
hi !!!!
i have a xml document which contains some special characters.(for exm ?).
if i give it DocumentBuilder.parse(File xmlfile) it gives an exception saying--
org.xml.sax.SAXParseException: Character conversion error: "Unconvertible UTF-8 character beginning with 0xae" (line number may b
e too low).
can anybody help me out solving this problem??
thanks in advance

siddharth
0
Comment
Question by:spatnaik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
Prasanna_Hebbar earned 100 total points
ID: 6251369
It is the job of xml author to make a document well formed. It can't find the characters like '&', '<', '>',  double quotes. These characters should be represented in xml as &amp;, &lt;, &gt;, etc.

So in this case if you are creating the xml document, then you should make sure that the xml is well formed. You can catch the exception and inform the user that the xml is not well formed and ask him to replace these characters.

NOTE : I don't think ? is a special character. I used xerces parser. I am able to parse the data which contains question mark.
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 9017833
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


[points to Prasanna_Hebbar]


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maven module vs maven project 3 74
Java: anonymous class 4 38
Java 8 to Java 6 8 33
What is the use of Forwarding Class in java 1 37
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to implement Singleton Design Pattern in Java.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question