on 04-18-2008 12:05 PM
Dear All,
This is a problem in mapping, we are facing.
Source Structure
Item------Occurance= 1 to Unbounded (Level 1)
Garment--- Occurance=1 to 1 (Level2)
Target Structure
target_Item--- Occurance = 3 to 5 (Level1)
target_Garment--- Occurance=1 to 1 (Level2)
Source Data
<Item>
<Garment> Blazer </Garment>
</Item>
<Item>
<Garment> Blazer </Garment>
</Item>
<Item>
<Garment> Blazer </Garment>
</Item>
<Item>
<Garment> Shirt</Garment>
</Item>
<Item>
<Garment> Trouser </Garment>
</Item>
Expected Target Data
<target_Item>
<target_Garment> Blazer </ target_Garment>
</target_Item>
<target_Item>
<target_Garment> Shirt </target_Garment>
</target_Item>
<target_Item>
<target_Garment> Trouser</ target_Garment>
</target_Item>
Mapping Done:-
Item -
> target_Item
Garment -
>. Remove Context -
> Split By Value(Value Change) -
> Collapse Context -
> Split By Value(Value Change) -
> target _Garment
But we are getting the following error.
Cannot produce target element /ns0:sdntarget/target_Item[4]/target_Garment. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
But when we see in DISPLAY QUEUE in the mapping Editor, every thing is showing as desired.
Can some body suggest, where we are wrong.
Regards,
Navneet
Hi navneet
Just do the below mapping for the target_item
Garment -
>. Remove Context -
> Split By Value(Value Change) -
> Collapse Context -
>target _item.
**Reward points if helpful
--Sankar Choudhury
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cleary ,In second level in target ,you mentioned it as
target_Garment--- Occurance=1 to 1 (Level2)
But in the sample data you have taken more than one.
So convert to 1 to some X
and check it again.
Let me know,
*******************Reward ,if found useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
do this
item-> Remove Context -
> Split By Value(Value Change) -
> Collapse Context -
> Split By Value(Value Change) ->target_item
Regards,
Rama Krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Navneet,
Go through this blog good blog for u r requirement..
/people/stefan.grube/blog/2005/12/29/new-functions-in-the-graphical-mapping-tool-xi-30-sp13
Thanks,
satya Kumar
reard points if its is Helpful..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As correctly said by Swarup change the occurrence.
What u did wrong is:
Item -
> target_Item -this mapping is not correct as from source u r getting four item hence the target_item will be generated 4 times.
Garment -
>. Remove Context -
> Split By Value(Value Change) -
> Collapse Context -
> Split By Value(Value Change) -
> target _Garment - this will generate only 3 times based on ur logic.
because of this u r getting error target_item[4].
use the below logic:
item-target_item
garment->splitbyvalue(value change)->collapse context-> target_item.
garment-target_garment
garment->splitbyvalue(value change)->collapse context->splitbyvalue(eachvalue)->target-garment.
chirag
Edited by: Chirag Gohil on Apr 18, 2008 5:34 PM
Dear Chirag,
Your solution almost resulted in the solution.
What I did is
garment->remove context->splitbyvalue(value change)->collapse context-> target_item.
(Added remove context after garment).
Can you pls explain, without using remove context, will it work? I am asking because, it is similar to some of the blogs.
Pls clarify.
Thanx a ton. Bravo,
Navneet
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.