|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38949 Cannot get xmlns value attribute
Submitted: 2006-09-25 14:18 UTC Modified: 2006-09-27 10:33 UTC
From: superruzafa at gmail dot com Assigned: rrichards
Status: Closed Package: DOM XML related
PHP Version: 5.1.6 OS: Windows XP
Private report: No CVE-ID:
 [2006-09-25 14:18 UTC] superruzafa at gmail dot com
Surely this is not a bug, because is too obvious, Perhaps is a fault of W3C spec.

I have a xml file, and I try to parse to get xmlns's attributes. Simplely:


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

Reproduce code:
$xml=new DOMDocument();

echo $xml->documentElement->getAttribute("xmlns");

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-27 10:33 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 10:01:43 2015 UTC