title: xpath looping to unknown number of nodes
body: <p>I've a xpath that looks like this:</p>
  
  <pre><code>$path = '//*[@id="page-content"]/table/tbody/tr[3]/td['.$i.']/div/a';
  </code></pre>
  
  <p>where <code>$i</code> goes from 1 to <strong>X</strong>. I would normaly use:</p>
  
  <pre><code>for($i=1; $i&lt;X;$i++){
    $path = '//*[@id="page-content"]/table/tbody/tr[3]/td['.$i.']/div/a';
    $nodelist = $xpath-&gt;query($path);
    $result = $nodelist-&gt;item(0)-&gt;nodeValue;
  };
  </code></pre>
  
  <p>However, in this case, I dont know how much is <strong>X</strong>. Is there any way to loop through this without knowing X?</p>