ID:               36116
 Updated by:       [EMAIL PROTECTED]
 Reported By:      info at intelligentstreaming dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         DOM XML related
 Operating System: Linux
 PHP Version:      5.1.2
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

you are mixing DOM level 1 functionality with namespaced document. DOM
specs will tell you that results will be unexpected when doing this.


Previous Comments:
------------------------------------------------------------------------

[2006-01-21 18:30:42] info at intelligentstreaming dot com

Description:
------------
DOMElement::setAttribute() allows one to specify a colon in the
attribute name, for example "xsi:type". If an attribute with a matching
namespace prefix and local name already exists in the element, the
creation of the new attribute will cause two identically-named
attributes to exist in the same element.


Reproduce code:
---------------
$dom = DOMDocument::loadXML("<root xmlns:somens='uri://bla'><element
somens:foo='bar' /></root>");

print $dom->firstChild->firstChild->setAttribute('somens:foo', 'baz');

print $dom->saveXML();

Expected result:
----------------
DOMElement::setAttribute() should return FALSE or throw an exception;
the DOMDocument should not be changed.


Actual result:
--------------
<?xml version="1.0"?>
<root xmlns:somens="uri://bla"><element somens:foo="bar"
somens:foo="baz"/></root>



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36116&edit=1

Reply via email to