tenderlove/nokogiri — pull request #633 by gimite (2012-03-11 08:24:18+00:00)
Title: doc.css("a[class='bar']") doesn't work if the XML document has default namespace

This code:

```
require "nokogiri"

xml = <

fuga

EOS

doc = Nokogiri.XML(xml)
p doc.css("link[rel='hoge']").size
```
should output 1 (I believe) but outputs 0 in Nokogiri 1.5.2. It outputs 1 correctly in Nokogiri 1.5.0.

The CSS selector above is converted to this XPath: "//xmlns:link[@xmlns:rel = 'hoge']"
But it seems default namespace is not applied to attribute names in XML.
http://www.w3.org/TR/selectors/#attrnmsp
So the XPath doesn't match. This pull request converts to "//xmlns:link[@rel = 'hoge']" instead, which works as expected.

```
p doc.xpath("//xmlns:link[@xmlns:rel = 'hoge']", {"xmlns" => "http://www.w3.org/2005/Atom"}).size
# => 0
p doc.xpath("//xmlns:link[@rel = 'hoge']", {"xmlns" => "http://www.w3.org/2005/Atom"}).size
# => 1
```