Support XLSX with prefixed XML files (#237)

While the standard is not to have prefixes, some XLSX files have XML files containing a prefix.
Microsoft has a tool that generates such files: https://msdn.microsoft.com/en-us/library/office/gg278316.aspx
This commit is contained in:
Adrien Loison committed 2016-05-29 22:16:59 -07:00
1 parent 2ed30321b4
commit 03866a6604
5 files changed
+119 -86

No files matched your search

+17
View File
@@ -95,6 +95,23 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expectedRows, $allRows);
}
/**
* @return void
*/
public function testReadShouldSupportPrefixedXMLFiles()
{
// The XML files of this spreadsheet are prefixed.
// For instance, they use "<x:sheet>" instead of "<sheet>", etc.
$allRows = $this->getAllRowsForFile('sheet_with_prefixed_xml_files.xlsx');
$expectedRows = [
['s1 - A1', 's1 - B1', 's1 - C1'],
['s1 - A2', 's1 - B2', 's1 - C2'],
['s1 - A3', 's1 - B3', 's1 - C3'],
];
$this->assertEquals($expectedRows, $allRows);
}
/**
* @return void
*/