title: php domdocument get node value where attribute value is
body: <p>Say my XML looks like this:</p>
  
  <pre><code>&lt;record&gt;
    &lt;row name="title"&gt;this item&lt;/row&gt;
    &lt;row name="url"&gt;this url&lt;/row&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p>Now I'm doing something like this:</p>
  
  <pre><code>$xml = new DOMDocument();
  $xml-&gt;load('xmlfile.xml');
  
  echo $xml-&gt;getElementByTagName('row')-&gt;item(0)-&gt;attributes-&gt;getNamedItem('title')-&gt;nodeValue;
  </code></pre>
  
  <p>But this just gives me:</p>
  
  <p>NOTICE: Trying to get property of non-object id</p>
  
  <p>Does anybody know how to get the node value where the "name" attribute has value "title"?</p>