You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In jQuery, you can do $el.find("> div") to match only div elements 1 level below current. Following from this, if we write $el.find("> div > p"), we can match <p> elements that are grandchildren of the current element.
This doesn't seem possible with jOOX, as this stacktrace is produced.
Exception in thread "main" org.joox.selector.ScannerException: Bad input!
at org.joox.selector.Scanner.scan (Scanner.java:1889)
at org.joox.selector CSS2XPath.css2xpath (CSS2XPath.java:51)
at org.joox.Impl.find (Impl.java:488)
at org.joox.Impl.find (Impl.java:81)
Are there any alternatives to do this other than chaining children method $el.children('div').children('p')?
Steps to reproduce the problem:
As above $el.find("> div > p")
Versions:
jOOX: 2.0.0
Java: 17
The text was updated successfully, but these errors were encountered:
If you have some time, why not give it a shot? I'll be happy to review your PR.
Alternatively, note that the CSS selector support is just convenience. You can always just use Match::xpath instead, i.e. `$el.xpath("./div/p"). Usually, you'll get farther with XPath than with CSS selectors.
Expected behavior and actual behavior:
In jQuery, you can do
$el.find("> div")
to match only div elements 1 level below current. Following from this, if we write$el.find("> div > p")
, we can match<p>
elements that are grandchildren of the current element.This doesn't seem possible with jOOX, as this stacktrace is produced.
Are there any alternatives to do this other than chaining children method
$el.children('div').children('p')
?Steps to reproduce the problem:
As above
$el.find("> div > p")
Versions:
The text was updated successfully, but these errors were encountered: