Bug #54382 [Opn->Csd]: DOMNode::getAttributeNodeNS doesn't get xmlns* attributes
| From: | krakjoe@php.net | Date: | Wed, 25 Jan 2017 21:00:09 +0000 |
| Subject: | Bug #54382 [Opn->Csd]: DOMNode::getAttributeNodeNS doesn't get xmlns* attributes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-206955@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=54382&edit=1
ID: 54382
Updated by: krakjoe@php.net
Reported by: koch at sevenval dot com
Summary: DOMNode::getAttributeNodeNS doesn't get xmlns*
attributes
-Status: Open
+Status: Closed
Type: Bug
Package: DOM XML related
Operating System: Linux
PHP Version: 5.2.17
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of arnoutboks@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=721a189742acc6fb6c2c6d98ce86eebe4e34d42a
Log: Fix bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes)
Previous Comments:
------------------------------------------------------------------------
[2011-03-25 15:30:43] koch at sevenval dot com
Description:
------------
DOMNode's getAttributeNodeNS method does not return xmlns* nodes.
[test.xml]
<?xml version="1.0" encoding="utf-8" ?>
<root xmlns="http://ns" xmlns:ns2="http://ns2">
<ns2:child />
</root>
getAttributeNodeNS("http://www.w3.org/2000/xmlns/",
"ns2") should return a node, as does getAttributeNode("xmlns:ns2").
Test script:
---------------
$xml=new DOMDocument();
$xml->load("test.xml");
$de = $xml->documentElement;
$ns2 = $de->getAttributeNodeNS("http://www.w3.org/2000/xmlns/",
"ns2");
if ($ns2 == NULL) {
echo 'namespace node does not exist.' . "\n";
} else {
echo 'namespace node prefix=' . $ns2->prefix . "\n";
echo 'namespace node namespaceURI=' . $ns2->namespaceURI . "\n";
}
Expected result:
----------------
namespace node prefix=ns2
namespace node namespaceURI=http://ns2
Actual result:
--------------
namespace node does not exist.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=54382&edit=1