nitin gupta wrote:
for eg <div class="foo"></div> is selected by the following query.
$class = "foo";
$xpath->query("//*...@class = '".$class."']");
But, this fails in case of multiple classes, i.e. does not select this :
<div class="foo bar"> </div>
The "contains" function would probably work, eg (untested):
$xpath->query("//div[contains(@class, '" . $class . "')]");
One more question: is this url valid : http://xyz.com/path with space.html
Nope. You can escape the url if you just HAVE to have spaces:
http://n00b.com/path%20with%20space.html
but why not use dashes?
http://pro.com/path-with-properly-indexed-spaces.html
-Dom