#48339 [Opn->Asn]: DOMElement::setIdAttribute() throws 'Not Found Error' exception

From: Date: Sun, 24 May 2009 18:12:24 +0000
Subject: #48339 [Opn->Asn]: DOMElement::setIdAttribute() throws 'Not Found Error' exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-137688@lists.php.net to get a copy of this message
ID: 48339 Updated by: johannes@php.net Reported By: greatwhitepine at bigfoot dot com -Status: Open +Status: Assigned Bug Type: DOM XML related Operating System: opensuse 11.1 PHP Version: 5.2.9 -Assigned To: +Assigned To: rrichards Previous Comments: ------------------------------------------------------------------------ [2009-05-19 23:17:23] greatwhitepine at bigfoot dot com 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 this bug report at http://bugs.php.net/?id=48339&edit=1

« previous php.bugs (#137688) next »