aspose file tools*
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Parsing issuse" Watch "XML Parsing issuse" New topic
Author

XML Parsing issuse

Sireesh Ganagam
Greenhorn

Joined: May 08, 2012
Posts: 19
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 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:246)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at VBSexe.convertXMLFileToString(VBSexe.java:146)
at VBSexe.main(VBSexe.java:61)
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12789
    
    5
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.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: XML Parsing issuse