cancel
Showing results for 
Search instead for 
Did you mean: 

Alternating 2 segment occurances in the target structure

former_member187447
Participant
0 Kudos

Hi

I have a scenario, where in i have to alternate 2 segments in the target multiple times.

Currently the target structure looks like this

GSH1

--LIN 0...Unbound

--- X

-- Y

--SNI 0....Unbound

--- L

--- K

After mapping i need to have the LIN and SN1 alternating and occur multiple times based a field from source

for example if field from source LFIMG = 3

then the target structure should occur

as

GSH1

---LIN[1]

---SN1[1]

---LIN[2]

---SN1[2]

---LIN [3]

---SN1[3]

As of now i am able to populate it as follows but not like above, is there any Graphical mapping method to do that or should i be doing with a UDF.

---LIN[1]

---LIN[2]

---LIN [3]

---SN1[1]

---SN1[2]

---SN1[3]

Accepted Solutions (1)

Accepted Solutions (1)

former_member200962
Active Contributor
0 Kudos

Unless you change the target structure you cannot achieve the alternating nodes. Type of mapping (JAVA/ XSLT/ Graphical) will behave in the same manner.

Your target structure should be something like:

GSH1

--Segment .....0..unbounded

---LIN ......0..1

---SN1 .....0..1

Apply logic to repeat the Segment node.

Regards,

Abhishek.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can achieve such output in graphical mapping , If you can modify your output Structure to:::

GSH1

-Row 0...Unbound

---LIN 0...Unbound

---SNI 0....Unbound

So your output like this is possible ::

GSH1

-Row[1]

---LIN[1]

---SN1[1]

-Row[2]

---LIN[2]

---SN1[2]

-Row[3]

---LIN[3]

---SN1[3]

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

This is not possible using graphical mapping unless you make a change to your target structure. However, you could consider looking at JAVA or XSLT mapping to solve your requirements.

For Java Mapping, refer to the thread below:

For XLST Mapping, I suggest you download the XML Bible and then directly skip to Chapter14 (XSL Transformation)

Hope this helps,

Mark