I'm trying to loop sibling nodes and am stuck. The source schema has multiple loops and the destination is flat. The issue is with the source sibling nodes. Here is my input:
<CONLoop1>
<CON>
<CON1>123456789</CON1>
</CON>
<N1Loop2>
<N1_2>
<N101>EN</N101>
<N102>ABC Company</N102>
<N103>9</N103>
<N104>000000001</N104>
</N1_2>
</N1Loop2>
<N1Loop2>
<N1_2>
<N101>EN</N101>
<N102>XYZ Company</N102>
<N103>9</N103>
<N104>000000002</N104>
</N1_2>
</N1Loop2>
<PADLoop1>
<PID>
<PID01>X</PID01>
<PID03>NE</PID03>
<PID04>NEPRPG1</PID04>
<PID05>111</PID05>
</PID>
</PADLoop1>
<PADLoop1>
<PID>
<PID01>X</PID01>
<PID03>NE</PID03>
<PID04>NEPRPG2</PID04>
<PID05>222</PID05>
</PID>
</PADLoop1>
<PADLoop1>
<PID>
<PID01>X</PID01>
<PID03>NE</PID03>
<PID04>NEPRPG3</PID04>
<PID05>333</PID05>
</PID>
</PADLoop1>
</CONLoop1>
I would like the information to end up in this table:
CON1 | N102 | NEPRPG1 | NEPRPG2 | NEPRPG3 |
123456789 | ABC Company | 111 | ||
123456789 | ABC Company | 222 | ||
123456789 | ABC Company | 333 | ||
123456789 | XYZ Company | 111 | ||
123456789 | XYZ Company | 222 | ||
123456789 | XYZ Company | 333 |
The challenge I'm having is that when I get to the N102 node I want to then loop through all of the PID nodes before moving on to the next N102 node. I was trying this type of mapping with no success:
<image>
I don't know how to 'nest' these sibling loops on the input and 'flatten' then on the output.
Any help would be appreciated.
Thanks
Greg
- Edited by gpatchev Tuesday, April 21, 2015 7:36 PM