Here is an excerpt of my xml :
<node/>
<node/>
<node id="1">content</node>
<node/>
<node/>
<node/>
<node id="2">content</node>
<node/>
<node/>
I am positioned in the node[@id='1']
. I need an Xpath to match all the <node/>
elements until the next not empty node (here node[@id='2']
).
Edit: the @id attributes are only to explain my problem more clearly, but are not in my original XML. I need a solution which does not use the @id attributes.
I do not want to match the empty siblings after node[@id='2']
, so I can't use a naive following-sibling::node[text()='']
.
How can I achieve this ?