#48339 [NEW]: DOMElement::setIdAttribute() throws 'Not Found Error' exception

From: Date: Tue, 19 May 2009 23:17:23 +0000
Subject: #48339 [NEW]: DOMElement::setIdAttribute() throws 'Not Found Error' exception
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137544@lists.php.net to get a copy of this message
From: greatwhitepine at bigfoot dot com Operating system: opensuse 11.1 PHP version: 5.2.9 PHP Bug Type: DOM XML related Bug description: DOMElement::setIdAttribute() throws 'Not Found Error' exception Description: ------------ DOMElement::setIdAttribute() is broken in 5.2.9. It works properly in 5.2.6. Reproduce code: --------------- <?php // php_dom_setidattribute_bug.php $obj_domDocument = new DOMDocument( ); $obj_domElement = $obj_domDocument->createElement( 'test', 'This is the root element!' ); $obj_domElement = $obj_domDocument->appendChild( $obj_domElement ); $obj_domElement->setAttribute( 'xml:id', 1 ); $obj_domElement->setIdAttribute( 'xml:id', TRUE ); print $obj_domDocument->saveXML( ); ?> Expected result: ---------------- This should not throw any exception. Actual result: -------------- PHP Fatal error: Uncaught exception 'DOMException' with message 'Not Found Error' in /home/gwp/bin/php_dom_setidattribute_bug.php:13 Stack trace: #0 /home/gwp/bin/php_dom_setidattribute_bug.php(13): DOMElement->setIdAttribute('xml:id', true) #1 {main} thrown in /home/gwp/bin/php_dom_setidattribute_bug.php on line 13 Fatal error: Uncaught exception 'DOMException' with message 'Not Found Error' in /home/gwp/bin/php_dom_setidattribute_bug.php:13 -- Edit bug report at http://bugs.php.net/?id=48339&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48339&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48339&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48339&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=48339&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48339&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=48339&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=48339&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=48339&r=needscript Try newer version: http://bugs.php.net/fix.php?id=48339&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=48339&r=support Expected behavior: http://bugs.php.net/fix.php?id=48339&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=48339&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=48339&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=48339&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48339&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=48339&r=dst IIS Stability: http://bugs.php.net/fix.php?id=48339&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=48339&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=48339&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=48339&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=48339&r=mysqlcfg

« previous php.bugs (#137544) next »