David
David

Reputation: 165

Finding nodes with Xpath wildcard on name

I have a document with lots of nodes like this:

<FOO_A />
<SOMETHING />
<FOO_B />
<WHATEVER />
<FOO_C />

How can I use xpath to find all the nodes with names that match FOO_*? Thanks for all advice.

Upvotes: 1

Views: 1679

Answers (1)

Thomas W
Thomas W

Reputation: 15371

Short and sweet:

//*[starts-with(local-name(), 'FOO_')]

Upvotes: 4

Related Questions