changeset 2631:a5ec4089d990

Get the root node from the test prototype
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Thu, 19 Jan 2017 12:11:20 +0000
parents 3986de98f04a
children aa8d428fbb43
files php/requestKey.php
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/php/requestKey.php	Thu Jan 19 12:08:26 2017 +0000
+++ b/php/requestKey.php	Thu Jan 19 12:11:20 2017 +0000
@@ -61,8 +61,9 @@
 $doc_struct->loadXML("<waetresult/>");
 // Add the root
 if (file_exists($testURL)) {
-    $test_proto = new DOMDocument;
-    $test_proto->loadXML(file_get_contents($testURL, FILE_TEXT));
+    $test_proto_doc = new DOMDocument;
+    $test_proto_doc->loadXML(file_get_contents($testURL, FILE_TEXT));
+    $test_proto = $test_proto_doc->documentElement;
     $test_proto = $doc_struct->importNode($test_proto, true);
     $doc_struct->documentElement->appendChild($test_proto);
 }