#41467 [NEW]: Extra content at the end of the document
From: el_lenyas at hotmail dot com
Operating system: Windows Xp Sp2
PHP version: 5.2.2
PHP Bug Type: DOM XML related
Bug description: Extra content at the end of the document
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';
--
Edit bug report at http://bugs.php.net/?id=41467&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41467&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41467&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41467&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41467&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41467&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41467&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41467&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41467&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41467&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41467&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41467&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41467&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41467&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41467&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41467&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41467&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41467&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41467&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41467&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41467&r=mysqlcfg
Thread (5 messages)
- el_lenyas at hotmail dot com