From 51f477b6479820467c59ebdd4d6b7e4447cd9bb1 Mon Sep 17 00:00:00 2001 From: Nigel Banks Date: Sun, 13 Feb 2011 13:55:21 -0400 Subject: [PATCH] ISLANDORA-193: The code now creates a DOMDocument and calls loadXML() on that instance to prevent the warning. --- XMLDatastream.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/XMLDatastream.inc b/XMLDatastream.inc index 3998582d..9f1ea251 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -96,7 +96,13 @@ abstract class XMLDatastream { $this->dsid = $dsid; if ($xmlStr !== NULL) { - $this->xml = (is_object($xmlStr) && get_class($xmlStr) == DOMDocument) ? $xmlStr : DOMDocument::loadXML($xmlStr); + if(is_object($xmlStr) && get_class($xmlStr) == DOMDocument) { + $this->xml = $xmlStr; + } + else { + $this->xml = new DOMDocument(); + $this->xml->loadXML($xmlStr); + } } }