0
<entry name="A" />
<entry name="B" />
<entry name="C" />
<entry name="D" />
<entry name="E" />
<entry name="F" />
<entry name="." />
<entry name="." />
<entry name="." />
<entry name="Z" />

I want to select the "entry" nodes between B and F. Is there any way to select by combining both preceding and following-sibling? Currently, I am able to select this by finding position() of B and F. But I need a better solution.

  • 6
    Possible duplicate of [Combining the use of preceding and following sibling in the same xpath query](https://stackoverflow.com/questions/3388923/combining-the-use-of-preceding-and-following-sibling-in-the-same-xpath-query) – Andersson Sep 19 '17 at 14:44

1 Answers1

0

you can use xPath like next:

//entry[@name='B']/following::*[./following::entry[@name='F']]

Please see this is picture

Shok9894
  • 67
  • 4