ID: 41467
Updated by: [EMAIL PROTECTED]
Reported By: el_lenyas at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: DOM XML related
Operating System: Windows Xp Sp2
PHP Version: 5.2.2
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
Providing reproduce code depending on a local resource makes no sense.
Previous Comments:
------------------------------------------------------------------------
[2007-05-23 01:58:44] el_lenyas at hotmail dot com
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 this bug report at http://bugs.php.net/?id=41467&edit=1