Here is my XML code(module.xml)
<module code="ECSE502">
<code>ECSE502</code>
<name>Algorithms and Data structures</name>
<semester>1</semester>
<prerequisites>none</prerequisites>
<lslot>0</lslot>
<tslot>1</tslot>
<description>all about algorythms and data structers</description>
</module>
<module code="EIGA501">
<code>EIGA501</code>
<name>3D Grapgics I</name>
<semester>1</semester>
<prerequisites>none</prerequisites>
<lslot>2</lslot>
<tslot>3</tslot>
<description>xxxxxxxxxxxxxxxxxxxxxx</description>
</module>
According to the above xml code, I need to get the set by only giving ECSE502 as the input. After selecting the required node I need to get its child node's values also(name, semester,etc.). In the XML file there are 20 nodes. this is only the 1st 2 nodes.
I tried this so far
XmlTextReader reader = new XmlTextReader("modules.xml");
XmlDocument doc = new XmlDocument();
XmlNode node = doc.ReadNode(reader);
foreach (XmlNode chldNode in node.ChildNodes)
Console.WriteLine(reader.Value);