#49666 [NEW]: DomElement setAttribute() invalid charater
| From: | ralph at bean-it dot nl | Date: | Fri, 25 Sep 2009 10:09:13 +0000 |
| Subject: | #49666 [NEW]: DomElement setAttribute() invalid charater | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-142857@lists.php.net to get a copy of this message | ||
From: ralph at bean-it dot nl
Operating system: Windows
PHP version: 5.3.0
PHP Bug Type: DOM XML related
Bug description: DomElement setAttribute() invalid charater
Description:
------------
An invalid character error is raised when I want to set an attribute on
a DomElement.
When I put my code in a try ... catch everything works fine
Reproduce code:
---------------
$doc = new DOMDocument('1.0', 'iso-8859-1');
$node = $doc->createElement('test');
$newnode = $doc->appendChild($node);
$newnode->setAttribute("name application", "MyApp");
Raises an error
$newnode->setAttribute("0001", "File");
Also raises an error
Expected result:
----------------
The attribute is set on my DomElement
Actual result:
--------------
'DOMException' with message 'Invalid Character Error'
--
Edit bug report at http://bugs.php.net/?id=49666&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49666&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49666&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49666&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49666&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49666&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49666&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49666&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49666&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49666&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49666&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49666&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49666&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49666&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49666&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49666&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49666&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49666&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49666&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49666&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49666&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49666&r=mysqlcfg