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 (profile)
Status: Closed Package: DOM XML related
PHP Version: 5.1.6 OS: Windows XP
Private report: No CVE-ID: None
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC