#30966 [NEW]: set_attribute with namespace breaks xml
| From: | theseer@php.net | Date: | Thu, 02 Dec 2004 20:02:02 +0000 |
| Subject: | #30966 [NEW]: set_attribute with namespace breaks xml | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-69737@lists.php.net to get a copy of this message | ||
From: theseer@php.net
Operating system: Linux
PHP version: 4.3.9
PHP Bug Type: DOM XML related
Bug description: set_attribute with namespace breaks xml
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 bug report at http://bugs.php.net/?id=30966&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30966&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30966&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30966&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30966&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30966&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30966&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30966&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30966&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30966&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30966&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30966&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30966&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30966&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30966&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30966&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30966&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30966&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30966&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30966&r=mysqlcfg