on 10-26-2009 12:12 PM
Hi All,
i am trying to do the following mapping.
Source:
X Y
111 0010
111 0020
111 0030
222 0040
222 0050
target should be
111
|____0010
|____0020
|____0030
222
|____0040
|____0050
i am doing X -- Split by Value(value change) -- collapse context --- target field (header record)
and for Y -- Split by Value(value change) -- target field (item record)
the context change is happening properly ( i am getting the above structure), however the values are not coming correctly.
i am getting
111
|____0010
|____0020
|____0030
111 (should be 222)
|____0040 (item details are correct)
|____0050 (item details are correct)
i have done context change to <root>
any inputs ???
Regards,
Tarun Bafna
Hi Tarun,
try this
X -- Split by Value(value change) -- collapse context --- target field (header record)
Y -- RemoveContext -
> formatbyexample-- target field (item record)
X -- Split by Value(value change) --
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tarun,
Source is like this
<root> 1..1
<record> 1..unbounded
-<X> 1..1
-<Y>1..1
-<zzzz>1..1
</record>
</root>
target is IDOC
<IDOC>
<EDI_DC40>
<X> 1..100
-fielda
-<Y> 0: 100000
right?
map like this then
X --> splitbyvalue (value change) -->collapsecontext --> <X>
X --> splitbyvalue (value change) -->collapsecontext -->splitbyValue (each value)-> fielda
Y > removecontext
X --> splitbyvalue (value change)
Node X shoudl have field (say fielda) and <Y>
Regards
Suraj
Hi Suraj,
Still the same.
if i have just one line item in header,
111 0010
222 0020
333 0030
then the details are updating as desired. but when multiple line items or say multiple occurrence of same header record then problem arises
111 0010
111 0020
222 0030
Regards,
Tarun Bafna
Edited by: Tarun Bafna on Oct 26, 2009 2:23 PM
I defined following structure and it works fine. Please check and confirm.
Source Structure:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Source xmlns:ns0="http://aa.unilever.com/SC/XProc/InbLog/TrnsMgt">
<Record>
<X>111</X>
<Y>0010</Y>
</Record>
<Record>
<X>111</X>
<Y>0020</Y>
</Record>
<Record>
<X>222</X>
<Y>0030</Y>
</Record>
</ns0:Source>
Target Structure After mapping execution:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:Target xmlns:ns0="http://Sample">
<Header>
<T1>111</T1>
<Item>
<I1>0010</I1>
<I1>0020</I1>
</Item>
</Header>
<Header>
<T1>222</T1>
<Item>
<I1>0030</I1>
</Item>
</Header>
</ns0:Target>
Mapping:
X --> Remove Context --> Sort > Split by value change> Collapse Context --> Header
X --> Remove Context --> Sort > Split by value change> Collapse Context --> Split by each value --> T1
Constant --> Item
Format By example --> I1
(Y --> Remove Context) First Input to Format by example
(X --> remove context --> split by value change) second input to format by example
-Gouri
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.