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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: superruzafa at gmail dot com
New email:
PHP Version: OS:

 

 [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: Thu Nov 21 13:01:29 2024 UTC