Programming
Quick Tip: Read and Parse XML File With C#
Submitted by whiztech on Sun, 08/09/2009 - 03:43
While I was developing My Timer 0.1.0 beta 1, the hardest part for me to solve is how to parse the stored configuration file (which is in XML format) and read the values. It took me almost 2 days to figure out the best way to parse the XML file (at least it works for me). You can take a look at my example so you will have the idea to develop your own XML parser. The code is a bit long even though it only do a small task. I'll try my best to explain the code, if you have any questions feel free to drop a comment.
Our mission is to read and parse this XML file and output the data to the console application.
XML file: Students.xml
<School> <Student> <Name>Hussin Samad</Name> <Sex>Male</Sex> <DOB Day="10" Month="April" Year="1995" /> <Address>Lot 1000, Kg Raja, 22200 Besut, Terengganu, Malaysia</Address> <Email>hussin.samad@yahoo.co.uk</Email> <Phone>+60179245230</Phone> </Student> <Student> <Name>Mack W.
- whiztech's blog
- 1541 reads
- Comments
Tags:


