title: Grabbing an attribute with DOMXPath
body: <p>i know there are lots of way to grabbing an attribute.</p>
  
  <p>this is my html result :</p>
  
  <pre><code>&lt;li class="result"&gt;
  &lt;a class="block_container" href="**FIRST**"&gt;
  &lt;img alt="changeable text" src="**SOME LINK**" border="0"&gt;
  &lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li class="result"&gt;
  &lt;a class="block_container" href="**SECOND**"&gt;
  &lt;img alt="changeable text" src="**SOME LINK**" border="0"&gt;
  &lt;/a&gt;
  &lt;/li&gt;
  
  
  //and many like this ...
  </code></pre>
  
  <p>i can grab (href) but i have many of this attribute !</p>
  
  <p>i used DOMXPath query to help me choose grab first href or second href with item number :</p>
  
  <pre><code>$a = $xpath-&gt;query("//li[@class='block_container']/a");
  echo $text = $a-&gt;item(**MY ITEM NUMBER**)-&gt;nodeValue;
  </code></pre>
  
  <p>but it doesn't work !</p>
  
  <p>can you help me grab href and src with item number ?</p>