From 71b4ac9c56f87763011e480257874103ea16bbf6 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Tue, 17 Jun 2014 15:48:39 +0200 Subject: [PATCH] FIXED : #282 : problem converting docx to pdf PHP Catchable fatal error: Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /var/www/xxx/PhpWord/Reader/Word2007.php on line 145 and defined in /var/www/xxx/PhpWord/Shared/XMLReader.php on line 99, referer: XXX --- src/PhpWord/Shared/XMLReader.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PhpWord/Shared/XMLReader.php b/src/PhpWord/Shared/XMLReader.php index 153152ee..ca6869eb 100644 --- a/src/PhpWord/Shared/XMLReader.php +++ b/src/PhpWord/Shared/XMLReader.php @@ -96,7 +96,11 @@ class XMLReader $this->xpath = new \DOMXpath($this->dom); } - return $this->xpath->query($path, $contextNode); + if (is_null($contextNode)) { + return $this->xpath->query($path); + } else { + return $this->xpath->query($path, $contextNode); + } } /**