on 03-14-2011 1:08 PM
Hi Guys
I have the follwing situation
<M>
<regsegm>
<regnr>10</regnr>
</regsegm>
<regsegm>
<regnr>20</regnr>
</regsegm>
<regsegm>
<regnr>30</regnr>
</regsegm>
</M>
<M>
<regsegm>
<regnr>20</regnr>
</regsegm>
<regsegm>
<regnr>30</regnr>
</regsegm>
<regsegm>
<regnr>40</regnr>
</regsegm>
</M>
Target
<H>
<customsegm>
<custnr></custnr>
</customsegm>
</H>
I have to create one <customsegm> for each <regsegm> , this is easy to do , but for the custnr I have to map
the first occurence of regnr of each node M to alle the custnr node of each <H> node .
for instans here in the source structure we have to create 2 <H> nodes .
3 customsegm nodes with 3 custnr field for each
that is for the first 3 customsegm node there has to be 3 regnr node with the value 10 for each,
and for the second 3 customsegm node there has to be 3 regnr node with the value 20 for each.
copy value will only take the first one for alle the 6 custnr field
any help will do
Thanks
Hi,
Use one as many.
1st input: REGNR (Context on M)--> Collapse Context -->Split By each value
2nd and 3rd Input: regsegm (Context on M)
Out Put of Use One as many to split by each value to custnr.
It will work.
-Gouri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I understand correctly you want to sort the value in this order first node 10 , second node 20 ,20 , third node 30 ,30 , used SORT funtion or remove context and split by value ...this will help...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gouri
Sorry I was to fast
actually the source structure can also be as following
<M>
<regsegm>
<regnr>10</regnr>
</regsegm>
<regsegm>
<regnr>20</regnr>
</regsegm>
<regsegm>
<regnr>30</regnr>
</regsegm>
</M>
in this case we should map each first regnr for custnr for each customsegm.
that is in this case 3 customsegm node with 3 different custnr
<H>
<customsegm>
<custnr>10</custnr>
</customsegm>
<customsegm>
<custnr>20</custnr>
</customsegm>
<customsegm>
<custnr>30</custnr>
</customsegm>
</H>
but i some cases where the use as mnay as you suggested works can be like this
M>
<regsegm>
<regnr>10</regnr>
<regnr>20</regnr>
<regnr>30</regnr>
</regsegm>
</M>
in this case we have only one target customsegm node with the first value of regnr as 10.
plz suggest
Thanks
Edited by: Merhej Mati on Mar 15, 2011 3:21 PM
Hi,
Can you clarify what is source payload and what is target payload required?
I tried with what you have given and with my mapping output is also correct.
Source Payload
<?xml version="1.0" encoding="UTF-8"?>
<ns0:SDN xmlns:ns0="http://PurchaseRequest_Info">
<M>
<regsegm>
<REGNR>10</REGNR>
</regsegm>
<regsegm>
<REGNR>20</REGNR>
</regsegm>
<regsegm>
<REGNR>30</REGNR>
</regsegm>
</M>
</ns0:SDN>
Output
<?xml version="1.0" encoding="UTF-8"?>
<ns0:SDN_Target xmlns:ns0="http://PurchaseRequest_Info">
<H>
<customsegm>
<custnr>10</custnr>
</customsegm>
<customsegm>
<custnr>20</custnr>
</customsegm>
<customsegm>
<custnr>30</custnr>
</customsegm>
</H>
</ns0:SDN_Target>
hi
have a look at the useOneAsMany function and how that works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.