Im试图对Team Element中的值进行计数时,会抛出所有Xml节点,并以以下格式将其填充到“列表”框中:Team1,Count3。Thnx寻求帮助
XmlNodeList nodeList = xmlDoc.GetElementsByTagName("Team");
foreach (XmlNode xNode in nodeList)
{
foreach (var item in xNode)
{
lstRegPartiData.Items.Add(xNode.InnerText + item);
}
}
我在这里尝试按值计算元素。
这是我的xml模板。
<Participants>
<Participant>
<DateTime>21.04.2018</DateTime>
<FullName>N1</FullName>
<Email>email@gmail.com</Email>
<Phone>123456789</Phone>
<DateOfBirth>00/00/1988</DateOfBirth>
<Team>Team1</Team>
<MainWeapon>T1</MainWeapon>
<MainWeaponChrono>120-130 m\s</MainWeaponChrono>
<WeaponClass>C1</WeaponClass>
<Comment>Hello World</Comment>
</Participant>
<Participant>
<DateTime>21.04.2018</DateTime>
<FullName>N1</FullName>
<Email>email@gmail.com</Email>
<Phone>987654321</Phone>
<DateOfBirth>00/00/1988</DateOfBirth>
<Team>Team1</Team>
<MainWeapon>T1</MainWeapon>
<MainWeaponChrono>120-130 m\s</MainWeaponChrono>
<WeaponClass>C1</WeaponClass>
<Comment>My Comment</Comment>
</Participant>
<Participant>
<DateTime>21.04.2018</DateTime>
<FullName>N1</FullName>
<Email>email@gmail.com</Email>
<Phone>123456789</Phone>
<DateOfBirth>00/00/1988</DateOfBirth>
<Team>Team1</Team>
<MainWeapon>T1</MainWeapon>
<MainWeaponChrono>120-130 m\s</MainWeaponChrono>
<WeaponClass>C1</WeaponClass>
<Comment>Hello World</Comment>
</Participant>
</Participants>
交互式爱情
相关分类