Select elements that are NOT the children of a particular class.

5 views
Skip to first unread message

Goddamnit

unread,
Dec 5, 2013, 5:19:13 AM12/5/13
to support-...@googlegroups.com
is there a way to get select only elements that are NOT the chlidren of a particular selector ? 

Something like - $cattreeNode = $qp->top()->find(':not(.parent_to_exclude)  .allnodes');

OR like        -  $cattreeNode = $qp->top()->find('.allnodes');
 $targetNodes = $cattreeNode->not('.parent_to_exclude >');

Possible ?

Thanks

TechnoSophos

unread,
Dec 6, 2013, 10:56:36 PM12/6/13
to support-...@googlegroups.com
Yes, you can use the :not pseudo-class. There's a little bit of documentation here: http://api.querypath.org/docs/_c_s_s_reference.html Mostly, though, it follows the definition of :not in the CSS3 selector spec.

You can also use the not() method (like you have above) and any of the filter* methods. Probably something like ->not('.parent_to_exclude > *') is the best.


--
You received this message because you are subscribed to the Google Groups "support-querypath" group.
To unsubscribe from this group and stop receiving emails from it, send an email to support-queryp...@googlegroups.com.
To post to this group, send email to support-...@googlegroups.com.
Visit this group at http://groups.google.com/group/support-querypath.
For more options, visit https://groups.google.com/groups/opt_out.



--
http://technosophos.com
http://querypath.org
Reply all
Reply to author
Forward
0 new messages