/**
  * Validate the object.
  * @return boolean
  */
 public function isValid()
 {
     libxml_use_internal_errors(true);
     $feed = new \DOMDocument();
     $result = $feed->load($this->xmlFile->getFilename());
     if ($result === false) {
         return false;
     }
     return (bool) @$feed->schemaValidate($this->xsdFile->getFilename());
 }
Example #2
0
 /**
  * Parse the XML file by invoking an XML reader.
  * Each XML object must be processed per line by the ParseObject method.
  * @return array
  */
 protected function parseXML()
 {
     $xml = simplexml_load_file($this->xmlFile->getFilename());
     return $this->parseData($xml);
 }