获取xml中所有某标签的内容
Posted 米斯特唐
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取xml中所有某标签的内容相关的知识,希望对你有一定的参考价值。
string regStr = "<A>([\\w\\W]+?)</A>";//匹配A标签正则表达式 Regex tmpReg = new Regex(regStr, RegexOptions.Compiled); MatchCollection matcheList = tmpReg.Matches(xml); if (matcheList.Count != 0) { for (int i = 0; i < matcheList.Count; i++) { list.Add(matcheList[i].Groups[0].Value); } }
以上是关于获取xml中所有某标签的内容的主要内容,如果未能解决你的问题,请参考以下文章