K
Kim
Im having problems getting the correct number from
System.Xml.XmlNodeList.Count so my loop will process all nodes named
<Folder>.
What am I doing wrong?
XML file (cut out):
<Configuration>
<Options>
<Settings>
<SourceFolders>
<Folder>C:\</Folder>
<Folder>D:\Test\</Folder>
</SourceFolders>
</Settings>
</Options>
</Configuration>
C# code:
System.Xml.XmlNodeList appItems =
appDoc.SelectNodes("Configuration/Options/Settings/SourceFolders");
System.Xml.XmlNode appItems_child;
for (int i = 0; i < appItems.Count; i++)
{
appItems_child = appItems.Item(i).SelectSingleNode("Folder");
<do other things here>
}
System.Xml.XmlNodeList.Count so my loop will process all nodes named
<Folder>.
What am I doing wrong?
XML file (cut out):
<Configuration>
<Options>
<Settings>
<SourceFolders>
<Folder>C:\</Folder>
<Folder>D:\Test\</Folder>
</SourceFolders>
</Settings>
</Options>
</Configuration>
C# code:
System.Xml.XmlNodeList appItems =
appDoc.SelectNodes("Configuration/Options/Settings/SourceFolders");
System.Xml.XmlNode appItems_child;
for (int i = 0; i < appItems.Count; i++)
{
appItems_child = appItems.Item(i).SelectSingleNode("Folder");
<do other things here>
}