#19247 [Opn->Fbk]: set_content does not replace contents

From: Date: Thu, 05 Sep 2002 14:59:59 +0000
Subject: #19247 [Opn->Fbk]: set_content does not replace contents
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18490@lists.php.net to get a copy of this message
ID: 19247 Updated by: jtate@php.net Reported By: dan@exaci.com -Status: Open +Status: Feedback Bug Type: DOM XML related Operating System: Redhat 7.3 kernel 2.4.18-3 PHP Version: 4.2.2 New Comment: If you xml is: <!xml> <root> <Node attr="1"> some text here </Node> </root> and you try to use set_content on the "Node" node it will append, but what happens when you use set_content on the "some text here" child node of type XML_TEXT_NODE? Previous Comments: ------------------------------------------------------------------------ [2002-09-05 07:39:50] dan@exaci.com As of v4.2.2 of PHP, with libxml version 2.4.19, set_content does not replace the content of the node, but only appends to it. Apache version is 1.3.26 There is no direct function to overwrite the contents of a node, and to do so requires a roundabout way of creating a new node, copying the children and properties, and then setting the content of that node and replace_node'ing it into the DoM. There should be. That, or set_content should have the expected behaviour of replacing the node content (if appending is required, that can be done by using get_content). Thanks in advance, Daniel ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19247&edit=1

« previous php.bugs (#18490) next »