Hi I am kind of new to XML and .NET. I was wondering how I can parse the following file. I want to be able to get the XmlNode based on an ID I will provide. Example:
<Data>
<Question id="1">
<Answer>ddd</Answer>
</Question>
</Data>
I want to somehow do this:
XmlDocument myDoc = new XmlDocument();
XmlElement myElem = myDoc.GetElementById("1");
Response.Write("Answer: "+myElem.ChildNodes[0].InnerXML);
This should give me the output of: "Answer: ddd".
Any help is greatly appricated, thank you.
Also I would prefer not to use LINQ, as I would like to master the XML component of .NET first.