<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
nitin gupta wrote:<br>
<blockquote
 cite="mid:4f59ac610910021244q34c6adb7x4f2b692fd51bb34c@mail.gmail.com"
 type="cite">
  <div><span class="Apple-style-span"
 style="font-family: -webkit-monospace; border-collapse: collapse; line-height: 16px; white-space: pre-wrap;">for
eg &lt;div class="foo"&gt;&lt;/div&gt; is selected by the following
query.</span></div>
  <div><font class="Apple-style-span" face="-webkit-monospace"><span
 class="Apple-style-span"
 style="border-collapse: collapse; line-height: 16px; white-space: pre-wrap;"><br>
  </span></font></div>
  <div><font class="Apple-style-span" face="-webkit-monospace"><span
 class="Apple-style-span"
 style="border-collapse: collapse; line-height: 16px; white-space: pre-wrap;">$class
= "foo";</span></font></div>
  <div><span class="Apple-style-span"
 style="font-family: -webkit-monospace; border-collapse: collapse; line-height: 16px; white-space: pre-wrap;">$xpath-&gt;query("//*[@class
= '".$class."']");</span></div>
  <div><font class="Apple-style-span" face="-webkit-monospace"><span
 class="Apple-style-span"
 style="border-collapse: collapse; line-height: 16px; white-space: pre-wrap;"><br>
  </span></font></div>
  <div><font class="Apple-style-span" face="-webkit-monospace"><span
 class="Apple-style-span"
 style="border-collapse: collapse; line-height: 16px; white-space: pre-wrap;">But,
this fails in case of multiple classes, i.e. does not select this :</span></font></div>
  <div><font class="Apple-style-span" face="-webkit-monospace"><span
 class="Apple-style-span"
 style="border-collapse: collapse; line-height: 16px; white-space: pre-wrap;"><br>
  </span></font></div>
  <div><span class="Apple-style-span"
 style="font-family: -webkit-monospace; border-collapse: collapse; line-height: 16px; white-space: pre-wrap;">&lt;div
class="foo bar"&gt; &lt;/div&gt;</span></div>
</blockquote>
The "contains" function would probably work, eg (untested):<br>
$xpath-&gt;query("//div[contains(@class, '" . $class . "')]");<br>
<br>
<blockquote
 cite="mid:4f59ac610910021244q34c6adb7x4f2b692fd51bb34c@mail.gmail.com"
 type="cite">
  <div>One more question: is this url valid : <a moz-do-not-send="true"
 href="http://xyz.com/path">http://xyz.com/path</a> with space.html</div>
</blockquote>
Nope. You can escape the url if you just HAVE to have spaces:<br>
<br>
<a class="moz-txt-link-freetext" href="http://n00b.com/path%20with%20space.html">http://n00b.com/path%20with%20space.html</a> <br>
<br>
but why not use dashes?<br>
<br>
<a class="moz-txt-link-freetext" href="http://pro.com/path-with-properly-indexed-spaces.html">http://pro.com/path-with-properly-indexed-spaces.html</a><br>
<br>
-Dom<br>
</body>
</html>