Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xpath find nodes without class and without id

How to find nodes without id and class attributes in a xhtml document ?

like image 451
astropanic Avatar asked Dec 22 '10 19:12

astropanic


1 Answers

From a comment of @astropanic (the OP):

I want all li nodes that doesn't have id or class attributes

Use:

//li[not(@id) and not(@class)]

This selects all li elements in the XML document such that the li element has no id and no class attributes.

like image 95
Dimitre Novatchev Avatar answered Sep 20 '22 17:09

Dimitre Novatchev