php.net |  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
Description:
------------
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:

[test.xml]

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

Reproduce code:
---------------
$xml=new DOMDocument();
$xml->load("test.xml");

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



Expected result:
----------------
"http://ns"

Actual result:
--------------
""

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-27 10:33 UTC] rrichards@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 07:02:06 2014 UTC