php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: himajin100000 at gmail dot com
New email:
PHP Version: OS:

 

 [2009-09-04 01:48 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-15 21:29 UTC] 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
 [2010-01-15 21:33 UTC] rrichards@php.net
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.


 [2010-02-03 20:04 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294446
Log: - fix bug #49463 (setAttributeNS fails setting default namespace)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC