|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-28 15:12 UTC] tony2001@php.net
[2007-06-05 01:00 UTC] php-bugs at lists dot php dot net
[2008-08-19 17:55 UTC] chandu dot mankar444 at gmail dot com
[2008-12-03 09:30 UTC] rishi dot ambala at gmail dot com
[2009-02-09 12:28 UTC] pxyz44 at gmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 12:00:01 2025 UTC |
Description: ------------ I have problem, tryin to fill and xml document. I load an xml i fill whith new information, but when is going to put the third node it says Extra content at the end of the document, and deletes the second node. It makes 2 nodes but when I try to make third node it says that error and delete the second node. Reproduce code: --------------- $usuario="ricardo"; $promedio=1000; $doc = new DOMDocument('1.0'); $doc->formatOutput = true; $xml=strval('http://localhost/chat_xml/test2.xml'); $doc->load($xml); $item = $doc->appendChild($doc->createElement('item')); $nick= $item->appendChild($doc->createElement('nick')); $nick->appendChild($doc->createTextNode('Ricardo')); $time= $item->appendChild($doc->createElement('time')); $time->appendChild($doc->createTextNode(time())); $rating= $item->appendChild($doc->createElement('rating')); $rating->appendChild($doc->createTextNode($promedio)); echo 'Wrote: ' . $doc->save("test2.xml") . ' bytes';