.xlsx file that opens w/ other applications is silently imported without content #510

Closed
opened 2016-11-30 15:13:33 +00:00 by rahul-ldn · 1 comment
rahul-ldn commented 2016-11-30 15:13:33 +00:00 (Migrated from github.com)

Hi there,

What reasons would there be for an excel file that (say) Apple Numbers can import without issue, failing silently with js-xlsx? By failing I mean no sheets are recorded, and the non-existent sheets are then not populated with data (obviously). No errors are sent to console.
test.xlsx

Thanks!

Hi there, What reasons would there be for an excel file that (say) Apple Numbers can import without issue, failing silently with js-xlsx? By failing I mean no sheets are recorded, and the non-existent sheets are then not populated with data (obviously). No errors are sent to console. [test.xlsx](https://github.com/SheetJS/js-xlsx/files/622118/test.xlsx) Thanks!
SheetJSDev commented 2017-03-10 04:13:39 +00:00 (Migrated from github.com)

In general it tries not to blow up if certain things look weird. Passing the option WTF:1 to read or readFile will suppress that behavior. In the node command that's the --dev option.

In this file, there were a few XML inconsistencies. For certain tags like numFmt, the spec asserts that the content must be empty. Excel and Numbers usually write these cells with an empty body but this file has a zero-length string body.

For example, here's the first number format (rename the XLSX file with a .zip extension, extract, and look at xl/styles.xml):

<numFmt numFmtId="82" formatCode="[$-010409]m/d/yyyy"></numFmt>

The expected form is

<numFmt numFmtId="82" formatCode="[$-010409]m/d/yyyy"/>

We will roll out a fix soon.

In general it tries not to blow up if certain things look weird. Passing the option `WTF:1` to read or readFile will suppress that behavior. In the node command that's the `--dev` option. In this file, there were a few XML inconsistencies. For certain tags like `numFmt`, the spec asserts that the content must be empty. Excel and Numbers usually write these cells with an empty body but this file has a zero-length string body. For example, here's the first number format (rename the XLSX file with a .zip extension, extract, and look at `xl/styles.xml`): ```xml <numFmt numFmtId="82" formatCode="[$-010409]m/d/yyyy"></numFmt> ``` The expected form is ```xml <numFmt numFmtId="82" formatCode="[$-010409]m/d/yyyy"/> ``` We will roll out a fix soon.
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#510
No description provided.