xpath Finding elements containing specific attributes Find all elements with a certain attribute

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Imagine the following XML:

<root>
    <element foobar="hello_world" />
    <element example="this is one!" />
</root>
/root/element[@foobar]

and will return the <element foobar="hello_world" /> element.



Got any xpath Question?