jsonkenl / xlsxir

Xlsx parser for the Elixir language.
MIT License
215 stars 85 forks source link

parse `inlineStr` cells within `t` XML elements #108

Closed superhawk610 closed 1 year ago

superhawk610 commented 2 years ago

When parsing a cell with data type inlineStr, the value is contained within this XML structure:

<is>
  <t>
    VALUE
  </t>
</is>

Previously, these values were parsed only if they followed a cell wrapped in a v element. This PR updates the worksheet parser to reset value_type after parsing each cell, and include t along with v as value_type: :value starters.

nathany-copia commented 2 years ago

I was getting nil values for text fields in some XLSX files until applying this patch.

👍🏻

RodolfoSilva commented 1 year ago

Here the spec:

https://learn.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.inlinestring?view=openxml-2.8.1#remarks