Character reference "&#x1F" is an invalid XML character Character reference "&#x1F" is an invalid XML character xml xml

Character reference "&#x1F" is an invalid XML character


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.


You can create a class that extends FilterReader to skip invalid XML characters. See this link.


The XML file is invalid, and the parser is telling you so. The control character decimal 31, hex 0x1F, can't appear in XML source. You need to have a look at the file and see what's going on.