Xpath finds nodes without class and without id

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

+8
css-selectors xhtml xpath
source share
1 answer

From the comment by @astropanic (OP):

Do I want all nodes that do not have id or class attributes

Using

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

This selects all li elements in the XML document, so the li element does not have id and class attributes.

+10
source share

Source: https://habr.com/ru/post/650391/


All Articles