-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
CSS3 not selector #205
Comments
Yes, this looks like a bug. :-( I believe the CSS parser is accepting this string, but translating it to the wrong XPath. I will investigate |
Updating with the CSS spec reference: |
I'm having this problem as well. Would be swell if it were fixed :) Doesn't seem like there is a function to support "not". |
fixing psuedo selectors and element selectors inside a not() function. closed by 746d086 |
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to use the :not() selector of CSS3 to filter out the first list item from an unordered list.
When I run this code however, I run into an error "RuntimeError: xmlXPathCompOpEval: function first-child not found"
d = Nokogiri::HTML.parse('<html><body><ul><li id="1">1</li><li id="2">2</li><li id="3"<3</li></ul></body></html>')
d.css('ul li:not(:first-child)')
I have tried changing the CSS selector as follows, and got some strange results:
d.css('ul li:not(#2)') # works
d.css('ul li:not(li)') # fails with error Nokogiri::CSS::SyntaxError: unexpected 'li' after ':not('
d.css('ul li:not(:last-child)') # fails with the same original error of function last-child not found
I believe that according to the spec at http://www.w3.org/TR/css3-selectors/#pseudo-classes, these CSS3 selectors should work?
Any help would be appreciated.
Matt
The text was updated successfully, but these errors were encountered: