Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

jfirebaugh opened this issue Jul 15, 2010 · 2 comments

Comments

@jfirebaugh
Copy link
Contributor

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

@flavorjones
Copy link
Member

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']"]

@flavorjones
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants