Check duplicate in xml file with specific columns

            XmlDocument returnXml = new XmlDocument();
            returnXml.Load(@"F:\Temp\CBNOTDupicate.xml");
            Func<XmlNode,string> delegateOfCBNOT = delegate(XmlNode node)
            {
                return node.SelectSingleNode("CB_Adjustment_number").InnerText.Trim() + "," +
                    node.SelectSingleNode("Ind_Ref_Number").InnerText.Trim();
            };

            string[] groupByColumnsForCBNOT = { "CB_Adjustment_number","Ind_Ref_Number" };
            bool haveDuplicate = false;
            var duplicatedRecordsTemp = returnXml.SelectNodes("CBNOTReportModel/CBNOTDetailRecords/CBNOTDetailRecord").Cast<XmlNode>();
            var duplicatedRecords = returnXml.SelectNodes("CBNOTReportModel/CBNOTDetailRecords/CBNOTDetailRecord").Cast<XmlNode>().
                GroupBy(r => delegateOfCBNOT(r)).
                Where(q => q.Count() > 1);

相关文章

引言 NOKIA 有句著名的广告语:“科技以人为本”。任何技术都是为了满足人的生产生活需要而产生的。具体...
Writer:BYSocket(泥沙砖瓦浆木匠) 微博:BYSocket 豆瓣:BYSocket Reprint it anywhere u want. 文章...
Writer:BYSocket(泥沙砖瓦浆木匠) 微博:BYSocket 豆瓣:BYSocket Reprint it anywhere u want. 文章...
http://blog.jobbole.com/79252/ 引言 NOKIA 有句著名的广告语:“科技以人为本”。任何技术都是为了满...
(点击上方公众号,可快速关注) 公众号:smart_android 作者:耿广龙|loonggg 点击“阅读原文”,可查看...
一、xml与xslt 相信所有人对xml都不陌生,其被广泛的应用于数据数据传输、保存与序列化中,是一种极为强...