Error while parsing XLSX with one of the file's name starting with uppercase letter inside #439

Closed
opened 2016-07-15 07:48:04 +00:00 by chikh · 2 comments
chikh commented 2016-07-15 07:48:04 +00:00 (Migrated from github.com)

I have a XLSX file containing xl/SharedStrings.xml inside. Trying to run:

require('xlsx').readFile(path)

leads to the error: Cannot find file xl/sharedStrings.xml in zip. The problem is that my SharedStrings starts with uppercase letter but the parser tries to get sharedStrings which begins with lowercase letter.

Please, consider my PR to solve the issue: https://github.com/SheetJS/js-xlsx/issues/439
Another PR: https://github.com/protobi/js-xlsx/pull/46

I have a XLSX file containing `xl/SharedStrings.xml` inside. Trying to run: ``` js require('xlsx').readFile(path) ``` leads to the error: `Cannot find file xl/sharedStrings.xml in zip`. The problem is that my SharedStrings starts with uppercase letter but the parser tries to get sharedStrings which begins with lowercase letter. Please, consider my PR to solve the issue: https://github.com/SheetJS/js-xlsx/issues/439 Another PR: https://github.com/protobi/js-xlsx/pull/46
reviewher commented 2017-02-23 04:57:44 +00:00 (Migrated from github.com)

@chikh do you have a sample file? For this error to occur, the [Content_Types].xml file must be pointing to xl/sharedStrings.xml with a lowercase s

@chikh do you have a sample file? For this error to occur, the `[Content_Types].xml` file must be pointing to `xl/sharedStrings.xml` with a lowercase `s`
SheetJSDev commented 2017-02-23 06:07:36 +00:00 (Migrated from github.com)

This is in fact a bug. Even though writers should be case-sensitive, readers should be case-insensitive according to ECMA-376 Part 2 Section 10.1.2 "Mapping Content Types".

The lay of the land is as follows:

reader Handling files where [Content_Types].xml case differs from ZIP
Excel 2016 Case insensitive for all files
LibreOffice Case insensitive for all files
Numbers Case sensitive for some parts, not for sharedstrings.xml
G Sheets Case sensitive for some parts, not for sharedstrings.xml
Numbers IOS Case sensitive for all files

Instead of duplicating the object and doing a check, it would be more efficient to check key by key

This is in fact a bug. Even though writers should be case-sensitive, readers should be case-insensitive according to ECMA-376 Part 2 Section 10.1.2 "Mapping Content Types". The lay of the land is as follows: | reader | Handling files where [Content_Types].xml case differs from ZIP | |-------------|----------------------------------------------------------------| | Excel 2016 | Case insensitive for all files | | LibreOffice | Case insensitive for all files | | Numbers | Case sensitive for some parts, not for sharedstrings.xml | | G Sheets | Case sensitive for some parts, not for sharedstrings.xml | | Numbers IOS | Case sensitive for all files | Instead of duplicating the object and doing a check, it would be more efficient to check key by key
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#439
No description provided.