title: Xpath filter by attribute value and select alternate attribute
body: <p>I am having trouble with an XPath query. I am using <code>//link[@rel='alternate']</code> but this returns a null nodeset. I am trying to write a query that will select the value of the href attribute for all <em>link</em> nodes where <em>rel=alternate</em></p>
  
  <p>What am I doing wrong?</p>
  
  <p>Below is a simplified sample of the xml structure I am working with.</p>
  
  <pre><code>&lt;feed&gt;
      &lt;entry&gt;
          &lt;id&gt;1980475&lt;/id&gt;
          &lt;link rel="post" href="http://..."&gt;&lt;/link&gt;
          &lt;link rel="edit" href="http://..."&gt;&lt;/link&gt;
          &lt;link rel="alternate" href="http://..."&gt;&lt;/link&gt;
      &lt;/entry&gt;
      &lt;entry&gt;
          &lt;id&gt;1980476&lt;/id&gt;
          &lt;link rel="post" href="http://..."&gt;&lt;/link&gt;
          &lt;link rel="edit" href="http://..."&gt;&lt;/link&gt;
          &lt;link rel="alternate" href="http://..."&gt;&lt;/link&gt;
      &lt;/entry&gt;
  &lt;/feed&gt;
  </code></pre>
  
  <p>Here is the php code I am using as well:</p>
  
  <pre><code>$xmlDoc = simplexml_load_file("somefile.xml");
  $nodelist = $xmlDoc-&gt;xpath("//link[@rel='alternate']");
  </code></pre>