Reputation: 1566
How to ignore first and last element in xpath? Couldnt find any example on the internet. I only found that you can use [position()>1]
to ignore first element but how i can ignore last too?
Upvotes: 11
Views: 6910
Reputation: 122414
You can use
[postion() < last()]
(if the expression appears in an XML document, for example an XSLT stylesheet, then you'll need to escape the <
as <
)
Upvotes: 4