Recursive Loop functionality that retains last position

b0yce

Usenet Archive
Joined
May 18, 2004
Messages
2
Reaction score
0
Hi all,

I am trying to create a recursive loop transformation that remembers last position of inner loop so that it continues from that point instead of the point from where the recursion started.

So if input XML is
<SIMPLE>
<1>
<2>
<3>
<4>
<5>
</SIMPLE>

And I want to embed 3 and 4 in a sub simple (this is a simplified example - logic is the same) to get the output; <SIMPLE> <1> <2> <SIMPLE> <3> <4> </SIMPLE> <5> </SIMPLE>

How would I do this. I have tried recursion using Apply Templates and Call Templates, but after completing the first sub simple that contains 3 and 4, the outer call is then waiting to process 4 again (after first evaluating 3), I want to be able to bypass this so that the outer starts at 5 according to the outcome of the inner recursion.

I can offer more explanation if needed, TIA

b0yce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top