Salut à tous , j'ai un gros problème avec simplexml , je voudrais utiliser la méthode addChild.
Auparavant j'avais un hébergement chez ovh 90plan , cela fonctionnais mais je suis passé sur un serveur dédié il y peu.
Après l'install de LAMP , j'ai installé libxml2 et simplexml.
Le problème c'est que la méthode addChild n'est plus reconnue :
J'ai fait un petit script de test :Call to undefined method SimpleXMLElement::addChild()
et cela me renvoi :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 <?php $dom = new DOMDocument('1.0', 'utf-8'); $dom->loadXML('<test></test>'); $xml_out = simplexml_import_dom($dom); $class_methods = get_class_methods($xml_out); foreach ($class_methods as $method_name) { echo "$method_name\n"; } ?>
__construct asXML xpath registerXPathNamespace attributes children getNamespaces getDocNamespaces
pas de addChild à l'horizon ...
Une solution ?
Merci d'avance
Partager