#26202 [Opn]: DomNode->set_content() method does not work propertly

From: Date: Tue, 11 Nov 2003 14:41:05 +0000
Subject: #26202 [Opn]: DomNode->set_content() method does not work propertly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-50227@lists.php.net to get a copy of this message
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

« previous php.bugs (#50227) next »