I receive quote files from a supplier in Excel 2003 XML format (LoadFormat.SpreadsheetML).
These files often include empty, self-closing Worksheet elements that cause NullReferenceException when loading into ASPOSE Workbook.
CODE:
Workbook workbook = new Workbook("example.xml", new LoadOptions(LoadFormat.SpreadsheetML));
XML Example causes Exception:
<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:str="http://exslt.org/strings"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:o="urn:schemas-microsoft-com:office:office">
<Worksheet ss:Name="Sheet1"/>
</Workbook>
If I edit the file and close the tag, ASPOSE is able to load the file:
<?xml version="1.0" encoding="UTF-8"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:str="http://exslt.org/strings"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:o="urn:schemas-microsoft-com:office:office">
<Worksheet ss:Name="Sheet1">
</Worksheet>
</Workbook>
Excel loads either example without error.
I’m requesting that ASPOSE add support for loading SpreadsheetML files that contain empty, self-closing Worksheet elements,
Thank you.