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

Top 5 Contributors of the Month
Imran Ghani

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Easy and best way to parse xml file? note the file is too large

Posted By: shankey     Posted Date: May 17, 2011    Points:5   Category :C#
hi all, i have a large xml file and i want to parse this file but the file parsing should be quick.
The code should be in c#

Please help me..

<x3 Unit="min">0.747087</x3>

Author: Maverick          Accepted Answer   
Posted Date: May 17, 2011     Points: 40   

Use the code below

string path = Server.MapPath("Your.xml");
XDocument xmlDoc = XDocument.Load(path);

var xmldata= from c in xmlDoc.Descendants("xx")
select new
x1= c.Element("x1").Value,
x2= c.Element("x2").Value,
x3= c.Element("x3").Value,
foreach (var c in xmldata)
string x1 = xx.x1;
string x2 = xx.x2;
string x3 = xx.x3;

Hope it helps.

Author: VinayMandavilli             
Posted Date: May 18, 2011     Points: 20   

Good One...

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

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