You are here: SimpleXML Error: Node no longer exists (using addChild()) « PHP Programming Language « IT news, forums, messages
SimpleXML Error: Node no longer exists (using addChild())

Posted by b.coolsaet on 01/29/07 17:29

Hi,

like the title says simplexml is giving me a "Node no longer exists"
error while using the addChild() function. Note that it's not giving
an error on the first addChild();

Can somebody help ?


code causing error:

$xml = simplexml_load_file("../xml/books.xml");

if($xml) {

$book = $xml->books->addChild('book');
$book->addChild('title',$this->myTitle); //
line 171
$book->addChild('subtitle',$this->mySubTitle);
$book->addChild('publisher',$this->myPublisher);
$book->addChild('year',$this->myYear);
$book->addChild('cover',$this->cover);
$book->addChild('cover_thumb',$this->cover_thumb); // line 176
}



xml structure:

<books>
<book>
<title></title>
<subtitle></subtitle>
<publisher></publisher>
<year></year>
<cover></cover>
<cover_thumb></cover_thumb>
</book>
</books>



complete error:

Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-
addChild]: Node no longer exists in C:\Program Files\XAMPP\xampp\htdocs
\php\Book.class.php on line 171

Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-
addChild]: Node no longer exists in C:\Program Files\XAMPP\xampp\htdocs
\php\Book.class.php on line 172

Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-
addChild]: Node no longer exists in C:\Program Files\XAMPP\xampp\htdocs
\php\Book.class.php on line 173

Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-
addChild]: Node no longer exists in C:\Program Files\XAMPP\xampp\htdocs
\php\Book.class.php on line 174

Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-
addChild]: Node no longer exists in C:\Program Files\XAMPP\xampp\htdocs
\php\Book.class.php on line 175

Warning: SimpleXMLElement::addChild() [function.SimpleXMLElement-
addChild]: Node no longer exists in C:\Program Files\XAMPP\xampp\htdocs
\php\Book.class.php on line 176

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация