I am trying to do a transformation like this.
Consider I am having a XML file :
<name>
<a>Andy</a>
<b>Emma</b>
<c>John</c>
<d>Cindy</d>
<e>May</e>
</name>
And now I wish to select all elements after <b>Emma</b> element,so the output will be like this:
<new>
<one>John</one>
<one>Cindy</one>
<one>May</one>
<new>
I can only done the condition by manually declare the condition as
[position()>2]
But is there any way to get the position automatically?Rough idea like this:
[position()>Emma] or [position()>b]
What you can do is
/name/*[. = 'Emma']/following-sibling::*or/name/b/following-sibling::*.