Solved

XML parsing error(Encoing type)

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 45
mapBully challenge 6 93
micro services vs rest web services 16 53
github account with ecipse 1 20
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now