Solved

XML parsing error(Encoing type)

Posted on 2001-07-02
2
685 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
thymeleaf natural templating vs JSP 2 100
Java Timer (static) 9 44
diffSum example 4 37
Unhandled exception type Exception 18 31
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

777 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