title: PHP xpath query not working
body: <p>I've got the following HTML code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;&lt;body&gt;&lt;h1&gt; &lt;span class="mw-headline" id="Discussie_over_Titel"&gt;Discussie over  Titel&lt;/span&gt;&lt;/h1&gt;
  &lt;div class="comments"&gt;
  &lt;div class="comment new"&gt;
  &lt;div class="newcommenttext"&gt;Klik op de button om een nieuwe opmerking te maken over &lt;a href="/index.php/Titel" title="Titel"&gt;Titel&lt;/a&gt;&lt;/div&gt;&lt;div class="buttons"&gt;&lt;a href="/index.php/Speciaal:GegevensBewerken/Comment?Comment%5BWS-Comment-page%5D=Titel&amp;amp;NewComment=Yes" title="" target="_self"&gt;Nieuwe opmerking&lt;/a&gt;&lt;/div&gt;
  &lt;div class="clear"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="comments"&gt;&lt;div&gt;
  &lt;/div&gt;&lt;div class="commentBlock"&gt;&lt;div class="comment" id="WikiSysop-"&gt;&lt;div class="poster"&gt;Door &lt;span class="usernamehighlight"&gt;WikiSysop&lt;/span&gt; op  &lt;span class="extradata"&gt;Type: Suggestie&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class="buttons"&gt;&lt;a href="/index.php/Speciaal:GegevensBewerken/Comment?Comment%5BWS-Comment-page%5D=Discussie%3A%28door%20WikiSysop%20op%20%29&amp;amp;NewComment=Yes" title="" target="_self"&gt;Reageer op deze opmerking&lt;/a&gt;&lt;span class="collapse"&gt;&lt;a href="/index.php?title=Collapse&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Collapse (de pagina bestaat niet)"&gt;Collapse&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="content"&gt;Wat is dit nou weer?
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;&lt;div class="commentBlock"&gt;&lt;div class="comment" id="WikiSysop-"&gt;&lt;div class="poster"&gt;Door &lt;span class="usernamehighlight"&gt;WikiSysop&lt;/span&gt; op  &lt;span class="extradata"&gt;Type: Suggestie&lt;/span&gt;
  &lt;/div&gt;
  &lt;div class="buttons"&gt;&lt;a href="/index.php/Speciaal:GegevensBewerken/Comment?Comment%5BWS-Comment-page%5D=Discussie%3A%28door%20WikiSysop%20op%20Stiekem%29&amp;amp;NewComment=Yes" title="" target="_self"&gt;Reageer op deze opmerking&lt;/a&gt;&lt;span class="collapse"&gt;&lt;a href="/index.php?title=Collapse&amp;amp;action=edit&amp;amp;redlink=1" class="new" title="Collapse (de pagina bestaat niet)"&gt;Collapse&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="content"&gt;Mega mooi!
  &lt;/div&gt;
  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="comments"&gt;
  &lt;div class="comment new"&gt;&lt;div class="newcommenttext"&gt;
  Klik op de button om een nieuwe opmerking te maken over &lt;a href="/index.php/Titel" title="Titel"&gt;Titel&lt;/a&gt;&lt;/div&gt;&lt;div class="buttons"&gt;&lt;a href="/index.php/Speciaal:GegevensBewerken/Comment?Comment%5BWS-Comment-page%5D=Titel&amp;amp;NewComment=Yes" title="" target="_self"&gt;Nieuwe opmerking&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;p&gt;&lt;br /&gt;
  &lt;/p&gt;&lt;p&gt;&lt;br /&gt;
  &lt;/p&gt;
  Klik hier om terug te keren naar &lt;a href="/index.php/Titel" title="Titel"&gt;Titel&lt;/a&gt;.&lt;/div&gt;
  &lt;/body&gt;&lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>To fetch all the comments I simply create a new dom parser:</p>
  
  <pre><code>$dom = new DOMDocument;
  libxml_use_internal_errors(true);
  $dom-&gt;loadHTML($text);      
  $xpath = new DOMXPath($dom);
  
  $xpathResult = $xpath-&gt;query("//div[@class='comments']//div[@class='comments']");
  </code></pre>
  
  <p>But somehow the xpath query ALWAYS returns 0. Even when i use //body. Any body knows why?</p>