#26202 [WFx]: DomNode->set_content() method does not work propertly
| From: | chregu@php.net | Date: | Tue, 11 Nov 2003 18:15:39 +0000 |
| Subject: | #26202 [WFx]: DomNode->set_content() method does not work propertly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-50238@lists.php.net to get a copy of this message | ||
ID: 26202
Updated by: chregu@php.net
-Summary: Problem with uri-string in function
xpath_register_ns()
Reported By: michael_makarov at hotmail dot com
Status: Wont fix
Bug Type: DOM XML related
Operating System: Linux
PHP Version: 4.3.3
New Comment:
shitty auto-form-completion... sorry again, will delete it in my
browser...
-> changed summary line to original line
Previous Comments:
------------------------------------------------------------------------
[2003-11-11 13:10:22] chregu@php.net
Just don't use set_content if you want reliable results. It's buggy as
hell ;)
create_text_node()/append_child() is the better approach
chregu
------------------------------------------------------------------------
[2003-11-11 09:41:04] michael_makarov at hotmail dot com
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();
?>
------------------------------------------------------------------------
[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