通过一个 ID获得XML中的其他匹配项

if (TeamPriceList != "")
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(TeamPriceList);
XmlNodeList nodeList = xmldoc.SelectNodes("/TeamPrice/Price");
for (int n = 0; n < nodeList.Count; n++)
{
string StandardID = nodeList[n].Attributes["ID"].Value;
if (Standard == StandardID)
{
XmlNodeList childList = nodeList[n].ChildNodes;
for (int c = 0; c < childList.Count; c++)
{
if (childList[c].Name == "Standard")
StandardName = childList[c].InnerText;
}
}
}
}

你可能感兴趣的:(xml)