An invalid XML character (Unicode: 0x2) was found in the element content of the document




When parsing XML an error is generated

final XMLEventReader eventReader = createXmlReader(params);

while (eventReader.hasNext()) {

final XMLEvent event = eventReader.nextEvent(); // Throws Exception here

if (event.isStartElement()) {
final String elementName =
event.asStartElement().getName().getLocalPart();
depth++;


While reading


final XMLEvent event = eventReader.nextEvent(); the exception is created


Is it possible to create any validation for XMLEvent ?


No comments:

Post a Comment