matafagafo commented on PR #403:
URL: https://github.com/apache/poi/pull/403#issuecomment-1343118700
> What is the provenance of the xlsx that has a malformed SST file? I'd
personally be reluctant to add this unless malformed SSTs were common.
I want to put my 2 cents here.
We use POI to read user uploaded files, and we already received some XLSX
files with invalid counts, bellow a sample..
POI generates `NumberFormatException` parsing the file.
Trace:
```
java.lang.NumberFormatException: For input string: "4294749708"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:583)
at java.lang.Integer.parseInt(Integer.java:615)
at
org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable.startElement(ReadOnlySharedStringsTable.java:244)
``````
The user file SST was:
`<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
count="4294749708" uniqueCount="566">`
After opening with Excel (**without** errors or warnings showed by Excel)
and Saving As, the SST was corrected to:
`<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
count="2452" uniqueCount="566">`
I hope this helps to answer your question.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]