Subject: | [PATCH] Does not handle newlines in <Relationship> tags |
I have a .xlsx file generated by a reporting package that has newlines inside the <Relationship> tags in xl/_rels/workbook.xml.rels:
<Relationship Id="rId1"
Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"
Target="worksheets/sheet1.xml"/>
Spreadsheet::XLSX doesn't handle that, but the fix is simple: just add the /s modifier to the regex so it matches the newlines. Patch is attached.
Subject: | relationship.patch |
--- lib/Spreadsheet/XLSX.pm 2015-10-30 21:33:19.000000000 -0500
+++ lib/Spreadsheet/XLSX.pm 2016-01-11 09:59:34.913422993 -0600
@@ -253,7 +253,7 @@
my %rels = ();
- foreach ($member_rels->contents =~ /\<Relationship (.*?)\/?\>/g) {
+ foreach ($member_rels->contents =~ /\<Relationship (.*?)\/?\>/gs) {
my ($id, $target);
($id) = /Id="(.*?)"/;