Re: Re: Using DOM textContent Property
| From: | php at logi dot ca | Date: | Wed, 03 Sep 2008 15:58:07 +0000 |
| Subject: | Re: Re: Using DOM textContent Property | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279410@lists.php.net to get a copy of this message | ||
Lupus Michaelis wrote:
Tim Gustafson a écrit :That example was for finding email addresses and turning them into links, not the other thing about adding missing attributes. XPATH would be no help with the former.$Elements = $HTML->getElementsByTagName("*"); for ($X = 0; $X < $Elements->length; $X++) { ... SNIP ... }Why don't use the XPath ? <http://fr.php.net/manual/en/class.domxpath.php> <http://fr.php.net/manual/en/domxpath.query.php> This query fetch all a elements with no title attribute or empty title attribute : '//a[not(@title) or @title = ""]' ;