|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49463 setAttributeNS fails setting default namespace
Submitted: 2009-09-04 01:48 UTC Modified: 2010-01-15 21:33 UTC
From: himajin100000 at gmail dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 6SVN-2009-09-04 (snap) OS: Windows XP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
19 - 1 = ?
Subscribe to this entry?

 [2009-09-04 01:48 UTC] himajin100000 at gmail dot com
STEPS TO REPRODUCE: the "Reproduce Code" the DOM Core spec from 'if the qualifiedName or its prefix is "xmlns"'

Reproduce code:

$doc = new DOMDocument('1.0', 'utf-8');
$root = $doc->createElementNS('','rdf:RDF');
$root->setAttributeNS("","xmlns","" );


Expected result:
No Error.

Actual result:
Fatal error: Uncaught exception 'DOMException' with message 'Namespace Error' in C:\Environment\Users\WWW\OKWave\Q5261193\Q5261193-2.php060000:5
Stack trace:
#0 C:\Environment\Users\WWW\OKWave\Q5261193\Q5261193-2.php060000(5): DOMElement->setAttributeNS('http://www.w3.o...', 'xmlns', '')
#1 {main}
  thrown in C:\Environment\Users\WWW\OKWave\Q5261193\Q5261193-2.php060000 on line 5


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-15 21:29 UTC]
Automatic comment from SVN on behalf of rrichards
Log: fix bug #49463 (setAttributeNS fails setting default namespace)
add test
 [2010-01-15 21:33 UTC]
This bug has been fixed in SVN.

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.

 [2010-02-03 20:04 UTC]
Automatic comment from SVN on behalf of pajoye
Log: - fix bug #49463 (setAttributeNS fails setting default namespace)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 06:03:36 2021 UTC