XML : Get duplicate value from xml node

I have to get list of duplicate values from specific xml node.

  private static void GetDuplicateList(XmlDocument doc)          {              XmlNodeList lst1 = doc.SelectNodes("//node1");              XmlNodeList lst2 = doc.SelectNodes("//node2");                var values = new HashSet<string>();              //var xmlDocument = XDocument.Load(doc);                foreach (var node in doc.)              {                  if (!values.Add((string)node))                      node.Remove();              }           }    

enter image description here

No comments:

Post a Comment