Can anyone please tell me how to solve the following XML Exception?
Character reference &#x1F is an invalid XML character
I have a XML file with the character , When I try to parse this XML file I'm getting this Exception. Is there any way to resolve this?
The part of my code is like this...
File f = new File("sample.xml");
dom = db.parse(f);
I'm getting exception when I'm calling the function parse()
. I also tried with UTF8 encoding, and got the same exception.
Any help is much appreciated.
Thank u in advance!!!
As Michael Kay commented: There are more valid characters in XML 1.1 than in XML 1.0. In case the XML has a prolog that declares version 1.0 it might be sufficient to change the prolog from
<?xml version="1.0" >
to
<?xml version="1.1" >
If there are still invalid characters, you must decide how to deal with them. Streamflyer will ease your task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With