display all the data using a C# console application
XmlNodeList xmlnode = xmldoc.GetElementsByTagName("Book");
Console.WriteLine("Here is the list of catalogs\n\n");
for(int i=0;i<xmlnode.Count;i++)
{
XmlAttributeCollection xmlattrc = xmlnode[i].Attributes;
//XML Attribute Name and Value returned
//Example: <Book id = "001">
Console.Write(xmlattrc[0].Name);
Console.WriteLine(":\t"+xmlattrc[0].Value);
//First Child of the XML file - Catalog.xml - returned
//Example: <Author>Mark</Author>
Console.Write(xmlnode[i].FirstChild.Name);
Console.WriteLine(":\t"+xmlnode[i].FirstChild.InnerText);
//Last Child of the XML file - Catalog.xml - returned
//Example: <Publisher>Sams</Publisher>
Console.Write(xmlnode[i].LastChild.Name);
Console.WriteLine(":\t"+xmlnode[i].LastChild.InnerText);
Console.WriteLine();
Bookmarks