Hi there!
I would like to read an XML file, for example:
<?xml version="1.0">
<books>
<book>
<title>.NET For Dummies</title>
<author>Doc. Net</author>
</book>
<book>
<title>XML For Dummies</title>
<auther>C.U. There</author>
</book>
</books>
The problem is, I don't know how to parse it. This is how I would love it:
XMLReader reader = new XMLReader(fileStreamOfXmlFile);
Node[] top = reader.GetTopNode().GetNodes("book");
foreach(Node book in top)
{
Console.WriteLine("Title: {0}", book.GetNodes("title")[0];
Console.WriteLine("Author: {1}", book.GetNodes("author")[0];
}
Do such classes exist in the .NET Framework? There are so many classes that I can't see the wood trough the trees. If there aren't such classes, what would be the best other way to do such parsing?
Thanks beforehand!