wrong result for Nokogiri::CSS.xpath_for("[a='1'] [b='2']") #309

Closed
jfirebaugh opened this Issue Jul 15, 2010 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

jfirebaugh commented Jul 15, 2010

Expected:
["//[@A = '1']//[@b = '2']"]
Actual:
["//*[@A = '1' and @b = '2']"]

Owner

flavorjones commented Jul 16, 2010

Reproduced. Will take a look.

Workaround is to use the universal selector, '*':

Nokogiri::CSS.xpath_for("[a='1'] [b='2']") # => ["//*[@a = '1' and @b = '2']"]
Nokogiri::CSS.xpath_for("[a='1'] *[b='2']") # => ["//*[@a = '1']//*[@b = '2']"]
Owner

flavorjones commented Dec 31, 2014

This has been fixed for quite a long time! Sorry for not closing this years ago. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment