我有一个 XML 形式的树,将其存储在 XELement 变量中。我如何在 All Nodes 中搜索值XML,如果存在则返回 true?
请您参考如下方法:
试试这个:
bool result = element.DescendantsAndSelf().Any(e => e.Value == "cccc");
我有一个 XML 形式的树,将其存储在 XELement 变量中。我如何在 All Nodes 中搜索值XML,如果存在则返回 true?
请您参考如下方法:
试试这个:
bool result = element.DescendantsAndSelf().Any(e => e.Value == "cccc");