Click here to Skip to main content
16,019,263 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am trying to convert xml document to CSV file by node value for e.g

this is my sample xml file

XML
<account>
   <feild1>aaaaa</feild1>
   <feild2>aaaaa</feild2>
   <feild3>aaaaa</feild3>
   <feild4>aaaaa</feild4>
<products>
  <product>
    <feild1>bbbb</feild1>
    <feild2>bbbb</feild2>
    <feild3>bbbb</feild3>
    <feild4>bbbb</feild4>
  </product>
</products>
<persons>
  <person>
    <feild1>cccccc</feild1>
    <feild2>cccccc</feild2>
    <feild3>cccccc</feild3>
    <feild4>cccccc</feild4>
  </person>
</persons>
</account>




i need to display the output in excel as


account aaaa aaaa aaaa  aaaa 
product bbbb bbbb bbbb  bbbb
person  cccc cccc cccc  cccc


as a CSV File
Posted
Updated 25-Jan-13 14:38pm
v2

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Jan-13 10:33am    
One of the approaches, a 5.
I would first question why doing it at all. It's getting from data some less-of-date; and what's next?
—SA
fjdiewornncalwe 25-Jan-13 12:13pm    
+5 for the approach as well.
So what have you tried so far. We're not going to do your homework for you. Show us code snippets where you have problems and we'll be happy to help.
The reason we don't do homework for you: Compliments of JSOP[^]
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Jan-13 10:31am    
Right, tell them! A 5.
—SA
fjdiewornncalwe 25-Jan-13 12:13pm    
Thanks, Sergey
keerthi23 25-Jan-13 11:43am    
off course i know nobody wants to do others home work. i will put my code i did so far.
BYW thanks sergey
Sergey Alexandrovich Kryukov 25-Jan-13 12:28pm    
Marcus, not Sergey :-)
Make sure you put you code with "Improve question"...
—SA
keerthi23 25-Jan-13 12:30pm    
sorry i will put that now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900