ID: 47747 User updated by: mpeters at mac dot com Reported By: mpeters at mac dot com Status: Bogus Bug Type: DOM XML related Operating System: CentOS 5.2 PHP Version: 5.2.9 New Comment:
cool! Those properties just greatly reduced the code for what I am trying to accomplish. Thank you. Previous Comments: ------------------------------------------------------------------------ [2009-03-23 19:13:58] [email protected] Just for the record, if anyone is looking at that bug later: the following properties do also exist (but are not in the documentation yet) $attribute->namespaceURI $attribute->prefix $attribute->localName $attribute->nodeName; ------------------------------------------------------------------------ [2009-03-22 21:08:21] mpeters at mac dot com Nevermind - I got it figured out. It is bogus ------------------------------------------------------------------------ [2009-03-22 20:57:55] mpeters at mac dot com I updated the test case to create the attribute with the NS version of the function and the behavior is the same (as it also is if you load a valid xml file into DOMDocument) Here is why this needs to be fixed - script going through hundreds of elements, looking at the attributes. One element has 3 attributes that are the same but in different namespace. There's no way to generate an attribute list from which DOMAttr can distinguish the attributes as being in different namespaces, as it ignores the namespace with DOMAttr->name You may be able to distinguish via getAttributeNS but to use getAttributeNS you have to already know the namespace of the attribute you are looking at, and there seems to be no way to determine that from an attribute list (at least not generated by $node->attributes) So either because DOMAttr lacks functionality (ability to identify namespace) or because DOMAttr->name does the wrong thing (IE maybe it should include the namespace), the result is name clash that namespaces are suppose to avoid, thus DOM in php 5 is broken. ------------------------------------------------------------------------ [2009-03-22 20:28:45] mpeters at mac dot com Not bogus - There is no way via DOMAttr to even know that an attribute name is part of a nanespace because DOMAttr->name DROPS the namespace and DOMAttr does not provide a facility by which to even know it was ever there. ------------------------------------------------------------------------ [2009-03-22 20:20:10] [email protected] 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 Forgot to set it Bogus :) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/47747 -- Edit this bug report at http://bugs.php.net/?id=47747&edit=1
