POI: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity

Viewed 55

We are trying to process excel files using poi. The following is the relevant code

 currentHandler = new ISDAXLSXSheetToXMLHandler(sheetName, duplicates, rootEntityMapPerSheet, entitiesPerSheet, filename, updateFieldMarker, headerStart, headerOver);
 formatter = new DataFormatter();
 sheetSource = new InputSource(stream);
 sheetParser = XMLHelper.newXMLReader();
 handler = new XSSFSheetXMLHandler(styles, null, rosst, currentHandler, formatter, false);
 sheetParser.setContentHandler(handler);
 sheetParser.parse(sheetSource);
 stream.close();

For some of the files, it errors out with the following exception:

org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.

I tried unzipping the excel, and running a powershell script to validate all the XMLs within it. All XMLs looks to be valid.

Any suggestions on where should I look.

Thanks in advance :)

0 Answers
Related