Quantcast
Channel: Grouping XElement when generating XML from CSV - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Grouping XElement when generating XML from CSV

$
0
0

Say I have a *.csv that is generated by 3rd party and cannot be changed.

ProjectName Fruit, Apple Fruit, OrangeAnimal, DogAnimal, Cat

Using the tutorial described in Generate XML from CSV Files, I have no way but to delete the first line and obtain the following:

<Fruit><Apple></Apple></Fruit><Fruit><Orange></Orange></Fruit><Animal><Dog></Dog></Animal><Animal><Cat></Cat></Animal>

While I want to achieve the following, but cannot find any resource or tutorial to understand how about doing this:

<Project Name="ProjectName"><Fruit><Apple></Apple><Orange></Orange></Fruit><Animal><Dog></Dog><Cat></Cat></Animal></Project>

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>