Possible Duplicate:
Selecting a css class with xpath
I am trying to extract the source for all images inside a html like this
<li class="carousel_item">
<img src="http://www.xxxx.com/1fc1c1c2db5852e08ffcff38.jpg"
width="200"
height="200"
style="margin-bottom:1px"
class="image_error" />
<span class="image_error" title="jpg"></span>
<span class="image_error" title="2.jpg"></span>
</li>
When I use the following commands I get all images in the document
$nodelist = $xpath->query( "//img/@src" );
foreach ($nodelist as $n){
echo $n->nodeValue."<br>";
}
but I want just the items listed in the class="carousel_item"
Is this possible?