[development] Xpath query for class matching
nitingupta.iitg at gmail.com
Fri Oct 2 19:44:07 UTC 2009
For the module I am maintaining at drupal, I need to select the element
which has a specific class. I am using the following query for it:
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>
I don't have much experience in writing regex, can someone please help me
out with this.
One more question: is this url valid : http://xyz.com/path with space.html
Nitin Kumar Gupta
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the development