ID:               26202
 User updated by:  michael_makarov at hotmail dot com
 Reported By:      michael_makarov at hotmail dot com
 Status:           Open
 Bug Type:         DOM XML related
 Operating System: Windows XP Professional SP1
 PHP Version:      4.3.4
 New Comment:

code below works fine, but i don`t understand why i need
get child node for replacing content?
<?
$dom = domxml_open_mem("<?xml version=\"1.0\"
encoding=\"UTF-8\"?><Test>String1</Test>");
$node = $dom->document_element();
$cn  = $node->first_child();
$cn->set_content("String2");
echo $dom->dump_mem();
?>


Previous Comments:
------------------------------------------------------------------------

[2003-11-11 09:31:03] michael_makarov at hotmail dot com

Description:
------------
set_content() method does not replace node content
now it`s look like
new content = old content + function argument

this is not:
Bug #19247 
Bug #23710 




Reproduce code:
---------------
<?
$dom = domxml_open_mem("<?xml version=\"1.0\"
encoding=\"UTF-8\"?><Test>String1</Test>");
$node = $dom->document_element();
$node->set_content("String2");
echo $dom->dump_mem();
?>



Expected result:
----------------
<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>String2</Test>

Actual result:
--------------
<?xml version=\"1.0\" encoding=\"UTF-8\"?><Test>String1String2</Test>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26202&edit=1

Reply via email to