Lupus Michaelis wrote:
Tim Gustafson a écrit :

$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 = ""]' ;



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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to