Get partial data of XML file

I have this xml file which contains information from tagchimp, but the file contains way to much information. How do i only load the information i need. I have found some code:\[code\]XmlDocument doc = new XmlDocument();doc.Load(path);XmlElement root = doc.DocumentElement;XmlNodeList nodes = root.SelectNodes("movie");foreach (XmlNode node in nodes){ string date = node["tagChimpID"].InnerText; string name = node["locked"].InnerText; Console.WriteLine("Id:" + date + " Locked:" + name);} \[/code\]but it only loads the elements not the child elements, some for example movieTitle or shortDescriptionI found an way:\[code\]public static string Test(string path, XmlElement nodes) { string Name = ""; string releaseDate = ""; XmlNodeList xnList = nodes.SelectNodes("/items/movie"); XmlNode eNode; foreach (XmlNode xn in xnList) { eNode = xn.SelectSingleNode("movieTags/info/movieTitle"); if (eNode != null) { Name = eNode.InnerText; } eNode= xn.SelectSingleNode("movieTags/info/releaseDate"); releaseDate = eNode.InnerText; }\[/code\]but it's not the most practical way to come bye it.
 
Back
Top