1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| $admins = array();
if (file_exists("theme.xml")) {
$doc = new DOMDocument('1.0', 'UTF-8'); // Creation d'un domdocument
$doc->preserveWhiteSpace = FALSE;
$doc->load("theme.xml"); // Chargement de ce fichier loadXML
$xpath = new DOMXPath($doc);
$noeud = $xpath->query('//support[@idSupport="'.$idSupport.'"]', $doc);
echo ">".XML_ELEMENT_NODE." - ".XML_ATTRIBUTE_NODE." - ".XML_TEXT_NODE." - ".XML_CDATA_SECTION_NODE." - ".XML_COMMENT_NODE."<br />";
while ($noeud!=null) {
if ($noeud->firstChild->nodeType == XML_ELEMENT_NODE) { // XML_TEXT_NODE XML_ELEMENT_NODE
echo "1>".$noeud->firstChild->nodeName."<br />";
if (($noeud->firstChild->hasattribute("notif_mail")) && ($noeud->firstChild->getattribute("notif_mail")!="")) {
$admins = explode(";", $noeud->firstChild->getattribute("notif_mail"));
Break;
} else
$noeud = $noeud->firstChild->parentNode;
} else {
echo "2>".$noeud->item(0)->nodeName.": ".$noeud->item(0)->nodeType."<br />";
$noeud = $noeud->item(0)->parentNode;
} // */
}
}
echo var_dump($admins); |
Partager