Has someone know how to jump to the next element in xml? i.e
<xml>
<node></node>
<text number="2">Text number 2</text>
<text number="3">Text number 3</text>
...
<text number="N">Text number N</text>
...
<node></node>
</xml>
I would like to be able to jump to element with number 3 then iterate few times forward.
element2 = xpath('//text[@number="2"]')
element3 = element2.nextElement()
returns <text number="3">Text number 3</text>
element4 = element3.nextElement() ...
I know that I can find all elements with attribute 'number' then iterate over them but important for me is to be able to go to next element starting from selected (element after) - example is just simplified
Thanks :)