public function ParseEntities()
{
/**
* A default Exiftool XML can contains many RDF Descriptions
*/
$Entities = new ArrayCollection();
foreach ($this->getDomXpath()->query('/rdf:RDF/rdf:Description') as $node) {
/**
* Let's create a DOMDocument containing a single RDF result
*/
$Dom = new \DOMDocument();
$DomRootElement = $Dom->createElementNS(self::RDF_NAMESPACE, 'rdf:RDF');
$DomRootElement->appendChild($Dom->importNode($node, true));
$Dom->appendChild($DomRootElement);
$LocalXpath = new \DOMXPath($Dom);
$LocalXpath->registerNamespace('rdf', self::RDF_NAMESPACE);
$RDFDescriptionRoot = $LocalXpath->query('/rdf:RDF/rdf:Description');
/**
* Let's associate a Description to the corresponding file
*/
$file = $RDFDescriptionRoot->item(0)->getAttribute('rdf:about');
$Entities->set($file, new FileEntity($file, $Dom, new static()));
}
return $Entities;
}