Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xlsx/sheets.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (s *Sheet) parseSheet() error {
linkmap := make(map[string]string)
base := filepath.Base(s.docname)
sub := strings.TrimSuffix(s.docname, base)
relsname := filepath.Join(sub, "_rels", base+".rels")
relsname := strings.ReplaceAll(filepath.Join(sub, "_rels", base+".rels"), "\\", "/") // fix the sep in zip file is still "/" but on windows is "\"
dec, clo, err := s.d.openXML(relsname)
if err == nil {
// rels might not exist for every sheet
Expand Down
2 changes: 1 addition & 1 deletion xlsx/workbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (d *Document) parseRels(dec *xml.Decoder, basedir string) error {
// handle malformed "absolute" paths cleanly
d.rels[vals["Type"]][vals["Id"]] = vals["Target"][1:]
} else {
d.rels[vals["Type"]][vals["Id"]] = filepath.Join(basedir, vals["Target"])
d.rels[vals["Type"]][vals["Id"]] = strings.ReplaceAll(filepath.Join(basedir, vals["Target"]), "\\", "/") // fix EOF in windows for sep being "\" instead of "/"
}
if vals["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" {
d.primaryDoc = vals["Target"]
Expand Down
2 changes: 1 addition & 1 deletion xlsx/xlsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func Open(filename string) (grate.Source, error) {
// parse the secondary relationships to primary doc
base := filepath.Base(d.primaryDoc)
sub := strings.TrimSuffix(d.primaryDoc, base)
relfn := filepath.Join(sub, "_rels", base+".rels")
relfn := strings.ReplaceAll(filepath.Join(sub, "_rels", base+".rels"), "\\", "/") // fix EOF in windows for sep being "\" instead of "/"
dec, c, err = d.openXML(relfn)
if err != nil {
return nil, err
Expand Down