From 3a6ba3cac27e06260865b609e5ac27c3227fee05 Mon Sep 17 00:00:00 2001 From: Gianluca Giovinazzo Date: Fri, 4 Dec 2020 13:29:08 +0100 Subject: [PATCH] Fix for reading Namespaces only usend in root node --- src/PhpSpreadsheet/Reader/Xml.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PhpSpreadsheet/Reader/Xml.php b/src/PhpSpreadsheet/Reader/Xml.php index e4d251e28f..0f40ddc7b3 100644 --- a/src/PhpSpreadsheet/Reader/Xml.php +++ b/src/PhpSpreadsheet/Reader/Xml.php @@ -324,6 +324,8 @@ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet) $xml = $this->trySimpleXMLLoadString($pFilename); $namespaces = $xml->getNamespaces(true); + $namespacesDoc = $xml->getDocNamespaces(true); + $namespaces = array_merge($namespaces, $namespacesDoc); $docProps = $spreadsheet->getProperties(); if (isset($xml->DocumentProperties[0])) {