Hello,
I’ve data input like below and i must to transform it to target xml schema.I hope someone can guide.
ID Name Category Size Color
1 Productname1 Sports 55 Black
1 Productname1 Sports 56 Black
1 Productname1 Sports 57 Black
1 Productname1 Sports 58 Black
1 Productname1 Sports 59 Black
Example of obtanied XML output :
<xml>
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element0>
<Id>1</Id>
<Name>Productname1 </Name>
<Category>Sports </Category>
<Size>55 </Size>
<Color>Black</Color>
</Element0>
<element0>
<Id>1</Id>
<Name>Productname1 </Name>
<Category>Sports </Category>
<Size>56 </Size>
<Color>Black</Color>
</Element0>
----- Continue Like This----------------
</root>
</xml>
But i need output like this example:
<xml>
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element0>
<Id>1</Id>
<Name>Productname1 </Name>
<Category>Sports </Category>
<variants>
<Size>55 </Size>
<Color>Black</Color>
</variants>
<variants>
<Size>56</Size>
<Color>Black</Color>
</variants>
<variants>
<Size>57 </Size>
<Color>Black</Color>
</variants>
</Element0>
----- Continue Like This----------------
</root>
</xml>
I guess this is really hard question but we can change input data type.I’m open to suggestions.
I don’t want duplicated id or other columns in xml sheet.I need combine variants inside of node if id is duplicated.