#30966 [Opn]: set_attribute with namespace breaks xml

From: Date: Thu, 02 Dec 2004 20:03:37 +0000
Subject: #30966 [Opn]: set_attribute with namespace breaks xml
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-69738@lists.php.net to get a copy of this message
ID: 30966 User updated by: theseer@php.net Reported By: theseer@php.net Status: Open Bug Type: DOM XML related Operating System: Linux PHP Version: 4.3.9 New Comment: LibXML2 Version is 2.6.16 Previous Comments: ------------------------------------------------------------------------ [2004-12-02 21:02:00] theseer@php.net Description: ------------ When using $node->set_attribute on a previously existing attribute with a namespace, the attribute gets doubled rather then updated - interestingly enough, a second update does update the "doubled" attribute just fine... Additionally, $node->remove_attribute('test:attrib'); doesn't work with the previously existing attribute either while it removes the newly doubled attribute. Reproduce code: --------------- $dom=domxml_open_mem('<?xml version="1.0" ?><foo:root xmlns:test="http://test.de/xml" xmlns:foo="http://test.de/foo" test:attrib="0" />'); $root = $dom->document_element(); $root->set_attribute('test:attrib','1'); $root->set_attribute('test:attrib','2'); echo $dom->dump_mem(); Expected result: ---------------- <?xml version="1.0"?> <foo:root xmlns:test="http://test.de/xml" xmlns:foo="http://test.de/foo" test:attrib="2"/> Actual result: -------------- <?xml version="1.0"?> <foo:root xmlns:test="http://test.de/xml" xmlns:foo="http://test.de/foo" test:attrib="0" test:attrib="2"/> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30966&edit=1

« previous php.bugs (#69738) next »