XPathNodeIterator オブジェクトを foreach しようとしています
XPathNodeIterator xpCategories = GetCategories();
現在、xpCategories はこのような xml を保持しています
<root>
<category numberofproducts="0">
<id>format</id>
<name>Kopi/Print</name>
</category>
<category numberofproducts="1">
<id>frankering</id>
<name>Kopi/Print</name>
</category>
<category numberofproducts="0">
<id>gardbøjler</id>
<name>Møbler</name>
</category>
<category numberofproducts="0">
<id>gardknager</id>
<name>Møbler</name>
</category>
<category numberofproducts="0">
<id>gardspejle</id>
<name>Møbler</name>
</category>
</root>
そして、ループ内の各カテゴリノード「id」を取得する必要があります。このようなことを試しました
foreach (char str in xpCategories.Current.Value)
{
xpCategories.MoveNext();
}
しかし、役に立たない..誰かが私を正しい道に導くことができますか?