I would like to find an element named "test" with no attributes at all.
How can I do this using XPATH?
If I just query /test, it finds all the elements test, even those that contain attributes.
Example:
<main>
<test id="test1">txt</test>
<test>txt2</test>
</main>
The query for //testwill find for me both elements. I want only one that does not contain attributes. I can ask //test[not(@id)], but I was wondering if there is a command for an element with no attributes at all.
source
share