Handling Nested for loops in transformation XSLT
801667Jan 3 2013 — edited Feb 26 2020Hi,
I want to handle nested for each loops inside the transformation sheet.
I have two source collections and one target collection.
I have to Lookup the key value in source1 in source2 and if the key is found, i have to map value to target and if the key is not found, i want to may the key itself to target.
Below are the sample input and expected outputs from the transformation sheet. Please help in transforming to the required format.
Input
----------------------
------------------------
<Source1Collection>
<Group1>
<Key> a </Key>
<Value> i </Value>
</Group1>
<Group2>
<Key> b </Key>
<Value> ii </Value>
</Group2>
<Group3>
<Key> c </Key>
<Value> iii </Value>
</Group3>
</Source1Collection>
---------------------------------------
<Source2Collection>
<Feild1> z </Feild1>
<Feild1> x </Feild1>
<Feild1> c </Feild1>
<Feild1> v </Feild1>
<Feild1> b </Feild1>
</Source2Collection>
----------------------------------------
Output
--------------------------------------
--------------------------------------
<TargetCollection>
<Field1>a</Feild1>
<Field1>b</Feild1>
<Field1>iii</Feild1>
</TargetCollection>