1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
$xml->registerXPathNamespace("owl","http://www.w3.org/2002/07/owl#");
$owlClass = $xml->xpath("owl:Class");
$owlOneOf =$xml->xpath("owl:Class/owl:oneOf");
$owlThing=$xml->xpath("owl:Class/owl:oneOf/owl:Thing");
foreach($owlClass as $c){
foreach ($c->attributes('http://www.w3.org/1999/02/22-rdf-syntax-ns#') as $attribut0 => $item0) {
if($item0=="Author"){
foreach ($owlOneOf as $tag){
foreach($owlThing as $child){
foreach ($child->attributes('http://www.w3.org/1999/02/22-rdf-syntax-ns#') as $attribut1 => $valeur1) {
if($attribut1=="ID"){
$GLOBALS['auteurs'][$nbr_auteurs] = $valeur1;
$nbr_auteurs++;
}
}
}
}
}
}
} |
Partager