note 72693 added to function.dom-domdocument-getelementbyid
| From: | simon at somewhere dot com | Date: | Tue, 30 Jan 2007 04:07:06 +0000 |
| Subject: | note 72693 added to function.dom-domdocument-getelementbyid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122342@lists.php.net to get a copy of this message | ||
SAVE YOURSELF A MAJOR HEADACHE AND A LOT OF SEARCHING THROUGH DOCUMENTATION -
Instead of using $object->setAttribute('id', 'id_name_here')
USE THIS: $object->setAttribute('xml:id', 'id_name_here')
Then, to get the node value: $domDocumentObject->getElementById('id_name_here');
The xml:id attribute should AUTOMATICALLY be defined!!
Woohoo! That was easy......
----
Server IP: 69.147.83.197
Probable Submitter: 76.179.52.56
----
Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-getelementbyid.php
Edit -- https://master.php.net/note/edit/72693
Del: integrated -- https://master.php.net/note/delete/72693/integrated
Del: useless -- https://master.php.net/note/delete/72693/useless
Del: bad code -- https://master.php.net/note/delete/72693/bad+code
Del: spam -- https://master.php.net/note/delete/72693/spam
Del: non-english -- https://master.php.net/note/delete/72693/non-english
Del: in docs -- https://master.php.net/note/delete/72693/in+docs
Del: other reasons-- https://master.php.net/note/delete/72693
Reject -- https://master.php.net/note/reject/72693
Search -- https://master.php.net/manage/user-notes.php