Beispiel #1
0
 function testXMLToArrayOpen()
 {
     $xml = new XMLtoArray("");
     $this->assertError($xml->openXML());
     $xml = new XMLtoArray("unknown.xml");
     $this->assertError($xml->openXML());
     $xml2 = new XMLtoArray("jobSpecification.xml");
     $this->assertNoErrors($xml2->directory = "../specifications/xml/");
 }
Beispiel #2
0
 /**
  * @return array representing XML file contents
  * @desc Reads the xml file in and parses it
  */
 function process()
 {
     $count = 0;
     debug::message("XML spec:  " . $this->file . '<br>');
     $fp = XMLtoArray::openXML();
     while ($data = fread($fp, 4096)) {
         debug::message("\n" . $data . "\n");
         $this->parse($data);
         $count = $count - 1;
     }
     return $this->stack;
 }