This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XML Parsing issuse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Parsing issuse" Watch "XML Parsing issuse" New topic

XML Parsing issuse

Sireesh Ganagam

Joined: May 08, 2012
Posts: 28
Hello All,

How you doing. I have xml file generated i want to read rc , rm values in that but i am getting exceptions. How can i achieve this. Appreciate your help

Exceptions :

[Fatal Error] :7:46: Character reference "&x2" is an invalid XML character.
org.xml.sax.SAXParseException: Character reference "" is an invalid XML character.
at javax.xml.parsers.DocumentBuilder.parse(
at VBSexe.convertXMLFileToString(
at VBSexe.main(
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Obviously the first step will be to get a readable XML document by locating and fixing all those illegal characters.

How was this document generated? If it got anywhere near Microsoft word it may be contaminated with those accursed "smart punctuation" characters.

If you catch the SAXParseException try extracting the line and column number to help locate the bad character in the text.

A programmer's editor that can show and patch HEX values will be a big help too.

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 650
It's just a guess, but it looks like there is strange data in the <samplerData> element
david fields

Joined: Jun 06, 2011
Posts: 7
If youre still struggling there is afree online xml validator that will check your xml for you, you wont need to download anything.

I agree. Here's the link:
subject: XML Parsing issuse
It's not a secret anymore!