comparison php/requestKey.php @ 2751:6a36f5777af9

Alternative requestKey.php
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 25 Apr 2017 12:01:32 +0100
parents 7d619727130c
children a99c5f008c2d
comparison
equal deleted inserted replaced
2750:7d619727130c 2751:6a36f5777af9
56 // TODO: 56 // TODO:
57 // Generate the XML Base file and save it 57 // Generate the XML Base file and save it
58 $doc_struct = new DOMDocument; 58 $doc_struct = new DOMDocument;
59 $doc_struct->preserveWhiteSpace = false; 59 $doc_struct->preserveWhiteSpace = false;
60 $doc_struct->formatOutput = true; 60 $doc_struct->formatOutput = true;
61 $doc_struct->loadXML("<waetresult/>"); 61 $doc_struct->loadXML("<waetresult key=".$key."/>");
62 // Add the root 62 // Add the root
63 if (file_exists($testURL)) { 63 if (file_exists($testURL)) {
64 $test_proto_doc = new DOMDocument; 64 $test_proto_doc = new DOMDocument;
65 $test_proto_doc->loadXML(file_get_contents($testURL, FILE_TEXT)); 65 $test_proto_doc->loadXML(file_get_contents($testURL, FILE_TEXT));
66 $test_proto = $test_proto_doc->documentElement; 66 $test_proto = $test_proto_doc->documentElement;
67 $test_proto = $doc_struct->importNode($test_proto, true); 67 $test_proto = $doc_struct->importNode($test_proto, true);
68 $test_proto['key'] = $key;
69 $doc_struct->documentElement->appendChild($test_proto); 68 $doc_struct->documentElement->appendChild($test_proto);
70 } 69 }
71 // Add start time 70 // Add start time
72 // Add IP Address information 71 // Add IP Address information
73 // Save the file 72 // Save the file