on 09-11-2007 10:00 PM
<b>Input file:</b>
<?xml version="1.0" encoding="UTF-8" ?>
- <Group01>
<Field1>A1</Field1>
<Field2>A1_B1</Field2>
<Field3>A1_B1_C1</Field3>
</Group01>
- <Group01>
<Field1>A1</Field1>
<Field2>A1_B2</Field2>
<Field3>A1_B2_C1</Field3>
</Group01>
- <Group01>
<Field1>A1</Field1>
<Field2>A1_B2</Field2>
<Field3>A1_B2_C2</Field3>
</Group01>
- <Group01>
<Field1>A2</Field1>
<Field2>A2_B1</Field2>
<Field3>A2_B1_C1</Field3>
</Group01>
- <Group01>
<Field1>A2</Field1>
<Field2>A2_B2</Field2>
<Field3>A2_B2_C1</Field3>
</Group01>
- <Group01>
<Field1>A2</Field1>
<Field2>A2_B2</Field2>
<Field3>A2_B2_C2</Field3>
</Group01>
<b>Output file</b>
<?xml version="1.0" encoding="UTF-8"?>
<Group1>
<Feld1>A1</Feld1>
<Group2>
<Feld2>A1_B1</Feld2>
<Group3>
<Feld3>A1_B1_C1</Feld3>
</Group3>
</Group2>
<Group2>
<Feld2>A1_B2</Feld2>
<Group3>
<Feld3>A1_B2_C1</Feld3>
</Group3>
<Group3>
<Feld3>A1_B2_C2</Feld3>
</Group3>
</Group2>
</Group1>
<Group1>
<Feld1>A2</Feld1>
<Group2>
<Feld2>A2_B1</Feld2>
<Group3>
<Feld3>A2_B1_C1</Feld3>
</Group3>
</Group2>
<Group2>
<Feld2>A2_B2</Feld2>
<Group3>
<Feld3>A2_B2_C1</Feld3>
</Group3>
<Group3>
<Feld3>A2_B2_C2</Feld3>
</Group3>
</Group2>
</Group1>
Is it possible to do XI mapping without writing any UDF?
Thanks
Shubhankar
Hi Raj,
A1_B2 is coming twice in your output. I need only one time and under this it should create 2 group3 (A1_B2_c1 and A1_B2_C2).
<Group2>
<Feld2>A1_B2</Feld2>
<Group3>
<Feld3>A1_B2_C1</Feld3>
</Group3>
<Group3>
<Feld3>A1_B2_C2</Feld3>
</Group3>
</Group2>
Thanks for your help.
Regards,
Shubhankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raj,
As per your suggestion I am getting below output
<?xml version="1.0" encoding="UTF-8" ?>
- <Group1>
<Feld1>A1</Feld1>
- <Group2>
<Feld2>A1_B1</Feld2>
- <Group3>
<Feld3>A1_B1_C1</Feld3>
</Group3>
</Group2>
</Group1>
- <Group1>
<Feld1>A2</Feld1>
- <Group2>
<Feld2>A1_B2</Feld2>
- <Group3>
<Feld3>A1_B2_C1</Feld3>
</Group3>
</Group2>
</Group1>
I was trying with below rule for Group2
Field2------------------
formatByEample Group2
Field1[Change Context to higher node]--SplitByValue[Value Changed]
and it is almost working and giving the snapshot of my output. You can see same value A1_B2 is coming twice but I am expecting only one A1_B1. that is not happening.
- <Group2>
<Feld2>A1_B2</Feld2>
- <Group3>
<Feld3>A1_B2_C1</Feld3>
</Group3>
</Group2>
- <Group2>
<Feld2>A1_B2</Feld2>
- <Group3>
<Feld3>A1_B2_C2</Feld3>
</Group3>
</Group2>
Thanks
Shubhankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shubankar,
The below logic will solve your issue.
<b>Field1</b>[Change Context to higher node]-SplitByValue[Value Changed]-CollapseContext---<b>Group1</b>
<b>Field1</b>[Change Context to higher node]-SplitByValue[Value Changed]-SplitByValue[EachValue]----<b>Field1</b>
<b>Field1</b>SplitByValue[Value Changed]-<b>Group2</b>
<b>Field2</b>---<b>Field2</b>
If the occurrence of <b>Group3 is 1..1</b> then don't map anything.
If the occurrence of <b>Group3 is 0..1</b> then map like below
Constant[]----Group3
<b>Field3</b>[Change Context to higher node]-SplitByValue[EachValue]-<b>Field3</b>
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just use direct mapping as follows:
Group01 --> Group1
Field1 --> Feld1
Field2 --> Group2
Field2 --> Feld2
Field3 --> Group3
Field3 --> Feld3
No other Context functions are needed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes it is possible. Just use standard node functions
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Group1 and field1 are working but other groups are not working.
Field1(context to test02)-->SplitbyValue(value changed)-->CollapseContexts-->Group1
Field1(context to test02)-->SplitbyValue(value changed)-->CollapseContexts-->SplitByValue(each value) -->Field1
Now I am trying for Group2 and field2 but still I don't have answer.
If you have any answer then please tell me.
Thanks
Shubhankar
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.