note 101499 deleted from class.domnode by salathe
| From: | salathe@php.net | Date: | Tue, 21 Dec 2010 11:36:47 +0000 |
| Subject: | note 101499 deleted from class.domnode by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175092@lists.php.net to get a copy of this message | ||
Note Submitter: altreus at perl dot com
Reason: useless
----
Beware when using $node->firstChild when trying to access the first child *element*.
In some cases, the first child of your node may in fact be a DOMTextNode containing the whitespace
between your node's opening tag and the opening tag of the first child element. You should
generally be using XPath to find elements by name and position, and use $firstChild when you know
for sure that it is the first DOMNode that you want.