Reputation: 1525
I have an XML file to parse in which the element tags are of the form:
<mensa-1>
..
</mensa-1>
<mensa-2>
..
</mensa-2>
Is it possible to parse such elements via Xpath when the element names differ via a number at the end?
Upvotes: 0
Views: 32
Reputation: 242218
The following XPath expression returns all the elements whose names start with "mensa-":
//*[starts-with(name(),'mensa-')]
Upvotes: 1