ノードがコレクション内にあるときにノードの内部テキストを取得する方法はありますか現在私はこれを持っています
Collection<string> DependentNodes = new Collection<string>();
foreach (XmlNode node in nodes)
{
for (int i = 0; i < node.ChildNodes.Count; i++)
{
DependentNodes.Add(node.ChildNodes[i].InnerXml);
//the reason i'm using InnerXml is that it will return all the child node of testfixture in one single line,then we can find the category & check if there's dependson
}
}
string selectedtestcase = "abc_somewords";
foreach (string s in DependentNodes)
{
if(s.Contains(selectedtestcase))
{
MessageBox.Show("aaa");
}
}
文字列をデバッグするとき、またはインデックスにこれが含まれている場合[1行で]
<testfixture name="1" description="a">
<categories>
<category>abc_somewords</category>
</categories>
<test name="a" description="a">
<dependencies>
<dependson typename="dependsonthis" />
</dependencies>
</test>
</testfixture>
私がやろうとしているのは、「testfixture 1」に到達すると、「abc_somewords」が見つかり、「dependson typename」ノード(存在する場合)を検索して「typename」(「dependonthis」)を取得することです。