|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38850 lookupNamespaceURI does not return default namespace
Submitted: 2006-09-15 22:50 UTC Modified: 2006-09-16 14:10 UTC
From: reanjr at reanjr dot org Assigned:
Status: Closed Package: XML related
PHP Version: 5.1.6 and 5.2 OS: Win XP
Private report: No CVE-ID:
 [2006-09-15 22:50 UTC] reanjr at reanjr dot org
DOMNode->lookupNamespaceURI( prefix ) returns an empty string when prefix is empty.

According XML DOM Level 3 spec, when passed a null value, lookupNamespaceURI should return the default namespace for the node.

Reproduce code:
<root xmlns="">
  <!-- nothing to see here -->

$doc = DOMDocument::Load( 'test.xml' );
$node = $doc->documentElement;
$ns = $node->lookupNamespaceURI( null );  // or pass ''
echo( "namespace: $ns" );

Expected result:
Expected output

Actual result:
Actual output


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-15 23:07 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-09-15 23:45 UTC] reanjr at reanjr dot org
Tried in 5.2 CVS release.  Same problem.
 [2006-09-16 00:21 UTC] reanjr at reanjr dot org
Relevent part of the XML DOM Level 3 spec:
 [2006-09-16 14:09 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

 [2006-09-16 14:10 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.

really, this is fixed :)
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Tue Dec 01 18:01:33 2015 UTC