Aggregating nested loops into a simple loop
Convert an XML structure with nested loops into a flat CSV structure by aggregating nested loops.
Before you begin
About this task
This example uses the same input structure as in Combining nested loops into a simple loop. The goal of the transformation is to have a CSV file with a row for each Address element containing information about the delivery and the products.
The output structure contains multiple PartNumber and
ProductName elements so that each row can contain all the
products to be delivered to a specific address. It is defined as
follows:
AddressesShipping
Address (0:*)
Name
Street
City
State
Zip
Country
DeliveryNotes
PartNumber_1
ProductName_1
PartNumber_2
ProductName_2
PartNumber_3
ProductName_3
Procedure
Results
Name,Street,City,State,Zip,Country,DeliveryNotes,PartNumber_1,ProductName_1,PartNumber_2,ProductName_2,PartNumber_3,ProductName_3
Deandre King,4894 Winding Way,Southfield,MI,48075,USA,Please leave packages in shed by driveway.,872-AA,Lawnmower,926-AA,Baby Monitor,,
Burl Clark,3807 Pointe Lane,Fort Lauderdale,FL,33308,USA,,356-KX,Gas canister,,,,