I have an xml file that looks like this for example:
<money>
<bank id="1">
<name>Checking Account</name>
<description>John Doe account</description>
</bank>
<bank id="2">
<name>Savings Account</name>
<description>Bob Smith account</description>
</bank>
<bank >
.....
</bank>
</money>
I need to parse through, and get the attribute value of <bank>, and the node value of <name> and <description>. What is the best way to do that, using XmlDocument parser?
I think I need to do something like this:
XmlNodeList banknodes = doc.SelectNodes("/money/bank");
foreach (XmlNode xn in banknodes)
But I am not sure how to get the attritube value of the bank node and the regular values of the other non-attribute tags.
Any advice would be appreciated.