diff --git a/lib/xlsxir/parse_worksheet.ex b/lib/xlsxir/parse_worksheet.ex index 1e24ec7..4ce84b8 100644 --- a/lib/xlsxir/parse_worksheet.ex +++ b/lib/xlsxir/parse_worksheet.ex @@ -69,6 +69,7 @@ defmodule Xlsxir.ParseWorksheet do case attr do {:attribute, 's', _, _, style} -> Map.put(acc, "s", find_styles(styles_tid, List.to_integer(style))) + {:attribute, key, _, _, ref} -> Map.put(acc, to_string(key), ref) end @@ -91,6 +92,9 @@ defmodule Xlsxir.ParseWorksheet do %{state | value_type: nil} end + def sax_event_handler({:startElement, _, 'is', _, _}, state, _, _), + do: %{state | value_type: :value} + def sax_event_handler({:characters, value}, state, _, _) do case state do nil -> nil diff --git a/test/xlsxir_test.exs b/test/xlsxir_test.exs index 70d3a36..3090e76 100644 --- a/test/xlsxir_test.exs +++ b/test/xlsxir_test.exs @@ -147,4 +147,14 @@ defmodule XlsxirTest do [123, "baz"] ] end + + test "parses inline strings" do + {:ok, pid} = multi_extract("test/test_data/noShared.xlsx", 0) + on_exit(fn -> close(pid) end) + map = get_map(pid) + + assert map["A1"] == "Generated Doc" + assert map["B2"] == "pre 2008" + assert map["B3"] == "https://msdn.microsoft.com/en-us/library/office/gg278314.aspx" + end end