I need help with some XPath. Say I am working on XHTML. How do I select all the a
elements whose href
attribute is NOT empty and does not begin with, say, 'mailto:'?
Asked
Active
Viewed 8,083 times
13

StackOverflowNewbie
- 39,403
- 111
- 277
- 441
1 Answers
15
You can use the starts-with() function:
//a[@href != '' and not(starts-with(@href, 'mailto:'))]

Frédéric Hamidi
- 258,201
- 41
- 486
- 479