.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

convert xml into csv using xlst

Posted By: sridar1     Posted Date: March 18, 2011    Points:5   Category :.NET Framework
Hai,

I having sample xml file and xlst file in a web application.After creating these two files i want to convert it into csv format.How can i do this.Is it automatically converts into csv after writing this two files?or There is any c# coding for convert it into csv.Plz help me

Responses
Author: Dhiraj Ranka             
Posted Date: March 18, 2011     Points: 20   

To convert XML file to CSV file you can iterate through your XML elements and then put all the value in .CSV file using following pseudo code

XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
foreach (XmlElement folder in doc.SelectNodes("/folders/folder"))
{
string source = folder.SelectSingleNode("source").InnerText;
Console.WriteLine(source);
}

instead of writing to console you can write it to the .CSV file using System.IO.File object (http://msdn.microsoft.com/en-us/library/8bh11f1k.aspx )

Hope this helps

Hope this helps.

Thanks & Regards,
Dhiraj Ranka
http://www.twitter.com/dhirajranka | http://www.dhirajranka.com
Author: Rob Simpson             
Posted Date: May 26, 2011     Points: 20   

I know a very good page, maybe you should check if you can find there what you need: http://www.voip-sip-sdk.com/p_130-how-to-build-an-autodialer-in-c-using-the-ozeki-voip-sip-softphone-source-code-voip.html.

Hopefully it can help



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend