Closed luke-clifton closed 6 months ago
Hi @luke-clifton could you attach a test file maybe? I'd try to find some time over the weekend
If I make the below change, it can parse my file. (I've added the dropWhile (== '/')
in Codec.Xlsx.Parser
extractSheet ar sst contentTypes caches wf = do
let filePath = dropWhile (== '/') $ wfPath wf
file <- note (MissingFile filePath) $ Zip.fromEntry <$> Zip.findEntryByPath filePath ar
The file is the Profile.xlsx found in the Garmin FIT SDK
I've attached it here as well.
@luke-clifton I've checked the spec and according to the section "7.3.4 Mapping logical item names to ZIP item names" of Part 2 “Open Packaging Conventions” at https://ecma-international.org/publications-and-standards/standards/ecma-376/ we need to
Remove the leading forward slash (“/”) from the logical item name or, in the case of interleaved parts, from each of the logical item names within the complete sequence.
I guess the part of interleaved parts is not applicable to xlsx (at least I don't remember such a thing) Would you like to create a PR stripping any leading "/" in https://github.com/qrilka/xlsx/blob/426eb0ad3aa6686cfdff309d87a2428df0011f83/src/Codec/Xlsx/Parser.hs#L707 and with a comment why we do this?
Fixed in #172
I have an xlsx file that won't parse because:
That file is in the archive, but it seems that
findEntryByPath
returnsNothing
with the leading slash.https://github.com/qrilka/xlsx/blob/426eb0ad3aa6686cfdff309d87a2428df0011f83/src/Codec/Xlsx/Parser.hs#L358