Re: Re: Using DOM textContent Property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux