randym/axlsx — Issue #1: Repair warnings from Excel
Author: timblinq
Created: 2011-12-05 19:53:21+00:00
State: open

When creating a spreadsheet with this gem, I get a repair warning from Excel for Mac 2011, Version 14.1.3 (110805),
the same that you get when you have a corrupted xlsx document. Here is the repair log from Excel:

Repair Result to example1 00854.xml

Errors were detected in file 'Macintosh
HD:Users:tim:src:axlsx:example1.xlsx'

Excel completed file level validation and repair. Some
parts of this workbook may have been repaired or
discarded.

Repaired Records: Cell information from
/xl/worksheets/sheet1.xml

The repaired document appears to have all the correct data, though.

Here is a diff of the two sheet1.xml files pre and post repair follows:

1,2c1,15
<
<
---
>
> xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
> xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
> mc:Ignorable="x14ac"
> xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
>
>
>
>
>
>
>
> x14ac:dyDescent="0" />
4,6c17,19
<
<
<
---
>
>
>
9,32c22,30
<

<
<
<
<
< First
<
<
<
<
<
<
<
< Second
<
<
<
<
<
<
<
< Third
<
<
---
>

>
> 0
>
>
> 1
>
>
> 2
35,36c33,34
<

<
---
>

>
39c37
<
---
>
42,43c40,41
<
< 40881.18424629247
---
>
> 40881.184246292469
46a45,53
> header="0.5" footer="0.5" />
>
> xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main">
>
>
>
>

Files example1/xl/workbook.xml and example1-repaired/xl/workbook.xml differ significantly:

1,6c1,23
<
<
<
<
<
<
---
>
> xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
>
> rupBuild="21405" />
>
>
> windowHeight="15620" tabRatio="500" />
>
>
>
>
>
>
>
> xmlns:mx="http://schemas.microsoft.com/office/mac/excel/2008/main">
>
>
>
>

Additionally, Excel adds a few files:

Only in example1-repaired/docProps: core0.xml
Only in example1-repaired/xl: sharedStrings.xml
Only in example1-repaired/xl: theme

Any ideas on what's up and how we can get rid of the warning?

I'm on OS X Lion, with the default libxml (not libxml2 via homebrew) and in a gemset using the gems outlined in the axlsx gem's Gemfile. I also am using ruby-1.9.3-p0 but encountered the same issues under ree-1.8.7-2011.03

Here are the files I tested:
* http://dl.dropbox.com/u/2318857/example1.xlsx
* http://dl.dropbox.com/u/2318857/example1-repaired.xlsx