I have following Excel file:
My end result should looks like (example of output file for first entry):
<?xml version="1.0" encoding="utf-8"?>
<asset>
<asset_feature key="ItemID" value="12000"/>
<asset_feature key="Name" value="Name of the first item"/>
<asset_feature key="Price" value="1020.0"/>
</asset>
In order to achieve it on initial steps I use Row Normaliser
step and after it Group by
with type Concatenate strings separated by ,
. I am expecting to have this:
<asset_feature key="ItemID" value="12000"/>, <asset_feature key="Name" value="Name of the first item"/>, <asset_feature key="Price" value="1020.0"/>
and use technic from XML Add - creating multi level XML files
example for >, <
replacement, as: var xmlOutput=xmlOrderListNew.replace(">, <","><");
, but instead I get following result back (3 duplicated rows):
<asset_feature key="ItemID" value="12000"/>, <asset_feature key="Name" value="Name of the first item"/>, <asset_feature key="Price" value="1020.0"/>
<asset_feature key="ItemID" value="12000"/>, <asset_feature key="Name" value="Name of the first item"/>, <asset_feature key="Price" value="1020.0"/>
<asset_feature key="ItemID" value="12000"/>, <asset_feature key="Name" value="Name of the first item"/>, <asset_feature key="Price" value="1020.0"/>
so, to fix it I have to put extra transformation step for getting just Unique rows
. Transformation picture:
Question is: how to fix Group by
step to don't get duplicates without extra Unique rows
step, as XML Add - creating multi level XML files
doesn't have such issue?
Optional question 1: is there any simple way for concatenation in order to avoid replace(">, <","><")
step later?
Optional question 2: How to make pretty XML (with indentation) formatting?
Example Excel & transformation are here
Thank you in advice for your help.