|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-11-11 09:31 UTC] 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> PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 01:00:01 2025 UTC |
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(); ?>