How to display contents of a dictionary that takes String and Xmlnodelist as parameters?

697 views Asked by At

I want to output the contents of the dictionary i made that takes string and xmlnodelist as parameters but it only outputs the node.key, without the node values which are xmlnodelists.

Dictionary<string,XmlNodeList> chDictionary = new 
Dictionary<string,XmlNodeList>
XmlNodeList chNode = xmlfile.GetElementsByTagName("CH")
foreach (XmlElement node in chNode)
{
  chDictionary.Add(node.GetAttribute("Name"), node.ChildNodes);
}
foreach(KeyValuePair<string, XmlNodeList> xnode in chdictionary)
{
  Console.WriteLine(xnode.Key, xnode.Value);
}
Console.ReadLine();
0

There are 0 answers