0

I have the following XML structure:

<Stat name="outer">
   <Stat>
      ....
       <Stat name="inner1"></Stat>
       <Stat name="inner2"></Stat>
       <Stat name="inner3"></Stat>
      ....
   </Stat>
</Stat>

How can i get all the inner Stat node elements? Between outer and the inner children in can be any number of Stat node elements.

1 Answers1

1

//Stat[not(Stat)], i.e. a Stat node without any Stat children.

Variant of How to select all leaf nodes using XPath expression?
See also XPath - Get node with no child of specific type

Community
  • 1
  • 1
Andreas
  • 154,647
  • 11
  • 152
  • 247