Recursive Loop functionality that retains last position

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • b0yce

    #1

    Recursive Loop functionality that retains last position

    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
Working...