This change adds support for cells defined without a reference attribute.
According to this older issue for a different project, the r (reference) attribute is not required:
https://github.com/box/spout/issues/267
In this case, a cell's coordinates are to be determined based on location in the XML. I haven't been able to find documentation verifying that the reference attribute is actually optional but I have come across XLSX files that do not have the reference attribute.
Also included are an example file and test.
The PR does not address all parsing paths because significantly more changes were required. Specifically, when streaming rows, cells without an r attribute will still cause an error in Roo::Utils.extract_coordinate.
Other Information
It might be helpful to know the steps used to create the example file:
create an XLSX file with LibreOffice
unzip the file into an empty directory: unzip test.xlsx -d emptydir
edit xl/worksheets/sheet1.xml file so that all c elements do not have an r attribute. I also converted the cell definitions to be inline: <c s="0" t="inlineStr"><is><v>Test</v></is></c>.
removed the xl/sharedStrings.xml (since all values were changed to inline) and the docProps directory to minimize the contents
Summary
This change adds support for cells defined without a reference attribute. According to this older issue for a different project, the
r
(reference) attribute is not required: https://github.com/box/spout/issues/267 In this case, a cell's coordinates are to be determined based on location in the XML. I haven't been able to find documentation verifying that the reference attribute is actually optional but I have come across XLSX files that do not have the reference attribute. Also included are an example file and test. The PR does not address all parsing paths because significantly more changes were required. Specifically, when streaming rows, cells without anr
attribute will still cause an error inRoo::Utils.extract_coordinate
.Other Information
It might be helpful to know the steps used to create the example file:
unzip test.xlsx -d emptydir
xl/worksheets/sheet1.xml
file so that allc
elements do not have anr
attribute. I also converted the cell definitions to be inline:<c s="0" t="inlineStr"><is><v>Test</v></is></c>
.xl/sharedStrings.xml
(since all values were changed to inline) and thedocProps
directory to minimize the contents.xlsx
extention