I figured out one way to do it.
For each headed item, count its following siblings and subtract from this the number of siblings following the next headed item, effectively giving the position of the next headed item. (This could be shortened with an improved position function.) Then process...
I have a set of sibling item elements. Some of them have a child head element (headed items), and some do not (non-headed items).
<source>
<item><head/>1</item>
<item>2</item>
<item>3</item>
<item><head/>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<source>
I want to use their...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.