simpleXML - can't add children - why? - stuck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I'm struggling here, but no joy so far.

Having this XML file that I'm loading using simplexml_load_file():
http://pastebin.com/JiW3LxWM

I need to add some <domain:create> children nodes after line 8.

What do I need to add?
This:
http://pastebin.com/mT27g3ZN

In order to do so, I have used the following php snipped:
http://pastebin.com/a1gG8tXx

I'm getting this warning and, after it, a fatal error:
Warning: SimpleXMLElement::addChild() [simplexmlelement.addchild]:
Cannot add child. Parent is not a permanent member of the XML tree.
(line number 1 of last paste bin)

Fatal error: Call to a member function addChild() on a non-object
(line number 2 of last paste bin)

Note that:
The constant used is correct. The php version is higher then 5.1.
On the same command, later on this code, I was able to create child
nodes with no issues.

I'm far (veery far) from being a guru, so please, what can I do to
debug this, and find out what's going on?


Thanks a lot,
Márcio

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux