From 3a7f5415ea19de5dc5cbe826b172bf8a6c9a144e Mon Sep 17 00:00:00 2001 From: mroy Date: Thu, 16 Dec 2010 13:35:15 -0600 Subject: [PATCH] Updated so that validate() will pull the name from the root element if it exists. ISLANDORA-134 --- XMLDatastream.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/XMLDatastream.inc b/XMLDatastream.inc index 77c357de..aac49cc6 100644 --- a/XMLDatastream.inc +++ b/XMLDatastream.inc @@ -154,7 +154,7 @@ abstract class XMLDatastream { if ($this->valid === NULL) { $ret = TRUE; if ($this->xml == NULL) { - $this->fetchXml(); + $this->fetchXml(); } // figure out if we're dealing with a new or old schema $rootEl = $this->xml->firstChild; @@ -187,6 +187,10 @@ printerWindow.document.write(text); elseif ($rootEl->attributes->getNamedItem('schemaLocation') !== NULL) { //figure out where the schema is located and validate. list(, $schemaLocation) = preg_split('/\s+/', $rootEl->attributes->getNamedItem('schemaLocation')->nodeValue); + $name = $rootEl->getAttribute('name'); + if ($name !== FALSE) { + $this->name = $name; + } } $schemaLocation = NULL; return TRUE;