GetElementById dom xml php
tried
-
avion-f16 Messages postés 20367 Date d'inscription Statut Contributeur Dernière intervention -
avion-f16 Messages postés 20367 Date d'inscription Statut Contributeur Dernière intervention -
Bonjour,
j'ai un problème avec le getElementById,voici la partie de mon code qui pose problème
$dom = new DomDocument();
$dom->load('fichier.xml');
$racine =$dom->documentElement;
$neoud=$racine->appendChild($dom->createElement("graph","5"));
$noeud->setAttribute("gid","2008");
$noeud->setIdAttribute("gid",true);
$id = $dom->getElementById("gid");
$dom->save('fichier_test.xml');
quand je veux tester $id,ben c'est quoi qu'il arrive null(ou vide),bref,pourtant dans mon fichier xml de sortie tout se génere parfaitement.
pourriez vous m'eclairer?
Merci d'avance!
j'ai un problème avec le getElementById,voici la partie de mon code qui pose problème
$dom = new DomDocument();
$dom->load('fichier.xml');
$racine =$dom->documentElement;
$neoud=$racine->appendChild($dom->createElement("graph","5"));
$noeud->setAttribute("gid","2008");
$noeud->setIdAttribute("gid",true);
$id = $dom->getElementById("gid");
$dom->save('fichier_test.xml');
quand je veux tester $id,ben c'est quoi qu'il arrive null(ou vide),bref,pourtant dans mon fichier xml de sortie tout se génere parfaitement.
pourriez vous m'eclairer?
Merci d'avance!
A voir également:
- GetElementById dom xml php
- Xml viewer - Télécharger - Édition & Programmation
- Easy php - Télécharger - Divers Web & Internet
- Office xml handler - Télécharger - Traitement de texte
- Expert php pinterest - Télécharger - Langages
- Driveimage xml - Télécharger - Sauvegarde