Mark Beardsley <markbrdsly <at> tiscali.co.uk> writes:

> 
> Hard to say much at all without looking at one of these files. Could you
> possibly post one of the files that is causing issues for you? With your
> saying that opening and then re-saving cures the problems, I suspect that
> the files may contain something that is not to spec as far as POI is
> concerned. Do you know how these files were created? There are report
> generators that create files Excel will accept but POI will not I believe,
> although I cannot name one for you at the moment. I am certain that others
> know far more about this than do I but we can make a start if you could post
> one of the problematical files.
> 
> --
> View this message in context: 
> http://apache-poi.1045710.n5.nabble.com/Apache-POI-
Streaming-API-doesn-t-recognize-Excel-xlsx-content-tp5720197p5720213.html
> Sent from the POI - User mailing list archive at Nabble.com.
> 


I have the same issue here and can provide a sample xlsx-file.
I tried to parse Excel sheets provided by this site:
https://www.bondora.ee/en/invest/statistics/data_export
link to file:
https://www.bondora.ee/marketing/media/MonthlyOverview.xlsx

The problem I found seems to be related to the namespaces used within the xmls. 
If the workbook.xml only contains a default namespace und uses non-prefixed 
tags, the content is parseable. As soon as the xml does not use that shortcut, 
but uses prefixed elements, the implementation doesn't work no more.

I tried to fix the sample XLS2CSV (made the xml parser namespace-aware) but 
that didn't lead to a working version (although the parsing worked).
The next issue is the parsing of the sharedStrings.xml. This one is also not 
namespace-aware, so I still get empty values for all cells.

To me this seems like a bug in the poi library, since those Excel sheets are 
valid.

I will look further into the issue and report back if there is a chance of 
implementing this without changing too much code.

PS: I quick workaround is to load the excel sheet into LibreOffice and then 
save it again. LibreOffice than generates a xlsx-file with a default namespace.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to