Redian新闻
>
How to compare data in an Array and in Xml
avatar
How to compare data in an Array and in Xml# DotNet - 窗口里的风景
i*a
1
I am coding in C# .NET 3.5
Let's say I have a List, and an XML file with list if items.
What I want to do is compare the values of the two lists, and get the
difference.
I want two results, 1. items in List but not in XML, 2. items in XML but
not in List.
I can only think of looping through the List against XML, and another loop
for XML against the List.
Is there another way to do this quicker?
Also, I've been using Xml.Ling to process the XML on other parts of the
program and wonder if Ling offers anything I can use for this.
avatar
s*o
2
maybe you can use Enumerable.Except method. for more details, check:
http://msdn.microsoft.com/en-us/library/bb300779.aspx

【在 i****a 的大作中提到】
: I am coding in C# .NET 3.5
: Let's say I have a List, and an XML file with list if items.
: What I want to do is compare the values of the two lists, and get the
: difference.
: I want two results, 1. items in List but not in XML, 2. items in XML but
: not in List.
: I can only think of looping through the List against XML, and another loop
: for XML against the List.
: Is there another way to do this quicker?
: Also, I've been using Xml.Ling to process the XML on other parts of the

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。