From: mpeters at mac dot com
Operating system: CentOS 5.2
PHP version: 5.2.9
PHP Bug Type: DOM XML related
Bug description: DOMAttr returns incomplete attribute name
Description:
------------
I'm using php 5.2.5 - upgrading is not possible. Sorry.
DOMattr->name does not include anything before a : nor provide a way to
access what was before a : in an attribute name.
Reproduce code:
---------------
Let's say $node refers to the following node -
<something xml:lang="en" foo="alpha" bar="beta" />
$attributes = $node->attributes;
foreach ($attributes as attribute) {
print ($attribute->name . "\n");
}
will result in
lang
foo
bar
notice the xml: is missing from before the lang.
DOMAttr provides no way to know that lang had a xml: before it.
However -
$node->hasAttribute('lang') is false while
$node->hasAttribute('xml:lang') is true
Expected result:
----------------
Either $DOMAttr->name
needs to provide the full attribute name including namespace or provide a
way to know what (if any) the namespace for the attribute name is.
--
Edit bug report at http://bugs.php.net/?id=47747&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47747&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47747&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47747&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47747&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47747&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47747&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47747&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47747&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47747&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47747&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47747&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47747&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47747&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47747&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47747&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47747&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47747&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47747&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47747&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47747&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47747&r=mysqlcfg