qrilka / xlsx

Simple and incomplete Excel file parser/writer
MIT License
128 stars 62 forks source link

Parser (streamed): fix default value for cell type #154

Closed NikitaRazmakhnin closed 2 years ago

NikitaRazmakhnin commented 2 years ago

According to [ECMA-376] specification of XML schema of Excel default type for cell is n - number. This is how it is implemented in regular parser, but streamed option was a bit incorrect here.

Spec declares such schema: <xsd:attribute name="t" type="ST_CellType" use="optional" default="n"/>

According to specification if cell has no t attribute, it has a default value as n - number. But Untyped caused wrapping of numeric values into text instead. As far as I understand it should be CellDouble in all cases where t is omitted.

qrilka commented 2 years ago

Thanks @NikitaRazmakhnin Would you mind adding a test covering this case?

NikitaRazmakhnin commented 2 years ago

Thanks @NikitaRazmakhnin Would you mind adding a test covering this case?

Sure, will do! :)

NikitaRazmakhnin commented 2 years ago

@qrilka tests are done. I verified they fail with wrong value-type before fix and are green after the fix.

qrilka commented 2 years ago

@NikitaRazmakhnin please take a look into the failure with microlens

qrilka commented 2 years ago

Thanks @NikitaRazmakhnin for the contribution!