title: trouble getting node's text with php xpath
body: <p>I have the following html:</p>
  
  <pre><code>&lt;div class="data"&gt;
      &lt;p class="info"&gt;output&lt;/p&gt;
       &lt;p class="info"&gt;output2&lt;/p&gt;
  </code></pre>
  
  <p>I am trying to get the text "output" with the following</p>
  
  <pre><code>$xpath = new DOMXPath($dom);    
  
  foreach ($xpath-&gt;evaluate("//div[@class='data']/p[1]") as $elt) {
      $output=$elt-&gt;wholeText;
  }
  
  echo $output;
  </code></pre>
  
  <p>its not working . I'm getting 2 errors:</p>
  
  <pre><code>Message: Undefined property: DOMElement::$wholeText
  Message: Undefined variable: output
  </code></pre>
  
  <p>could anyone point me in thr right direction?</p>
  
  <p>Thanks in advance,</p>
  
  <p>Bill</p>