|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54382 DOMNode::getAttributeNodeNS doesn't get xmlns* attributes
Submitted: 2011-03-25 15:30 UTC Modified: -
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: koch at sevenval dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 5.2.17 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
37 + 37 = ?
Subscribe to this entry?

 [2011-03-25 15:30 UTC] koch at sevenval dot com
DOMNode's getAttributeNodeNS method does not return xmlns* nodes.


<?xml version="1.0" encoding="utf-8" ?>
<root xmlns="http://ns" xmlns:ns2="http://ns2">
    <ns2:child />

getAttributeNodeNS("", "ns2") should return a node, as does getAttributeNode("xmlns:ns2").

Test script:
$xml=new DOMDocument();
$de = $xml->documentElement;
$ns2 = $de->getAttributeNodeNS("", "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.


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-25 21:00 UTC]
Automatic comment on behalf of
Log: Fix bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes)
 [2017-01-25 21:00 UTC]
-Status: Open +Status: Closed
 [2017-01-30 18:59 UTC]
Automatic comment from SVN on behalf of krakjoe
Log: Documentation changes for bug #54382

Provided by anonymous 77704 (
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 09:01:29 2024 UTC