title: What is the difference between `@attr!="value"` and `not(@attr="value")` in XPath
body: <p>There is a HTML like this.</p>
  
  <pre><code>&lt;div class="paginate_box"&gt;
    &lt;span class="disabled prev_page"&gt;Back&lt;/span&gt;
    &lt;span class="current"&gt;1&lt;/span&gt;
    &lt;a rel="next" href="page2"&gt;2&lt;/a&gt;
    &lt;a rel="next" href="page3"&gt;3&lt;/a&gt;
    &lt;a class="next_page" rel="next" href="page2"&gt;Next&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>To get biggest number of the pages I wrote this.</p>
  
  <pre><code>doc = Nokogiri::HTML(html)
  doc.xpath('//div[@class="paginate_box"]/a[not(@class="next_page")]').last.text
  #=&gt; "3"
  </code></pre>
  
  <p>At first I wrote <code>a[@class!="next_page"]</code> instead of <code>a[not(@class="next_page")]</code>, but it didn't match the tag. Why it doesn't match? What am I doing wrong?</p>