#49463 [Opn->Csd]: setAttributeNS fails setting default namespace
| From: | rrichards@php.net | Date: | Fri, 15 Jan 2010 21:33:16 +0000 |
| Subject: | #49463 [Opn->Csd]: setAttributeNS fails setting default namespace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146718@lists.php.net to get a copy of this message | ||
ID: 49463
Updated by: rrichards@php.net
-Summary: setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","blah")
produces error
Reported By: himajin100000 at gmail dot com
-Status: Open
+Status: Closed
Bug Type: DOM XML related
Operating System: Windows XP SP3
PHP Version: 6SVN-2009-09-04 (snap)
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2010-01-15 21:29:57] svn@php.net
Automatic comment from SVN on behalf of rrichards
Revision: http://svn.php.net/viewvc/?view=revision&revision=293597
Log: fix bug #49463 (setAttributeNS fails setting default namespace)
add test
------------------------------------------------------------------------
[2009-09-04 01:48:10] himajin100000 at gmail dot com
Description:
------------
STEPS TO REPRODUCE:
1.run the "Reproduce Code"
2.read the DOM Core spec from 'if the qualifiedName or its prefix is
"xmlns"'
http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-ElSetAttrNS
Reproduce code:
---------------
<?php
$doc = new DOMDocument('1.0', 'utf-8');
$root = $doc->createElementNS('http://purl.org/rss/1.0/','rdf:RDF');
$root->setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://purl.org/rss/1.0/"
);
?>
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',
'http://purl.org...')
#1 {main}
thrown in
C:\Environment\Users\WWW\OKWave\Q5261193\Q5261193-2.php060000 on line 5
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49463&edit=1