#41258 [Opn->Bgs]: setAttributeNS has inconsistent behaviour when raising exceptions
| From: | rrichards@php.net | Date: | Wed, 02 May 2007 12:54:04 +0000 |
| Subject: | #41258 [Opn->Bgs]: setAttributeNS has inconsistent behaviour when raising exceptions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-112174@lists.php.net to get a copy of this message | ||
ID: 41258
Updated by: rrichards@php.net
Reported By: daniel dot oconnor at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: DOM XML related
PHP Version: 5.2.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Line 4 is fine as namespace URI with an associated prefix already
exists (it was created when from line 3). The prefix gets attached to
the attribute. Error messages are not a bug, but feel free to open a
feature request for more verbose messages though.
Previous Comments:
------------------------------------------------------------------------
[2007-05-02 08:55:59] daniel dot oconnor at gmail dot com
Description:
------------
Inconsistent behaviour when raising exceptions. No exception is raised
until line 10
Reproduce code:
---------------
<?php
$d = new DOMDocument();
$example = $d->createElementNS('http://foo.com','example');
$example->setAttributeNS('http://bar.com',
'bar:bar',"value");
$example->setAttributeNS('http://bar.com',
'monkey',"value");
$d = new DOMDocument();
$example = $d->createElementNS('http://foo.com','example');
$example->setAttributeNS('http://fish.com',
'bar:bar',"value");
$example->setAttributeNS('http://bar.com',
'monkey',"value");
Expected result:
----------------
1. An exception raised on the second setAttributeNS (line 4)
2. A more meaningful error than 'Namespace Error' - "No namespace
prefix found for <http://fish.com>"
Actual result:
--------------
An exception on line 10
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41258&edit=1