I am trying to walk through all the elements in each occurance of a selected
node but I cannot seem to find the correct syntax to use. A simplified copy
of the XML data is shown at the bottom of this post. I want to get a node
list for every occurance of <CGShows> and then step through the child nodes
for each of those occurances. I am trying code like this:
Dim ShowElements As XmlNodeList
ShowElements = xmldoc.SelectNodes("/NewDataSet/CGShows/")
but it doesn't return a node list. I tried changing it to ShowElements =
xmldoc.SelectNodes("/NewDataSet/CGShows/*") but that seems to return all the
child elements
How can I accomplish this?
========== Sample XML ===========
<?xml version = "1.0"?>
<NewDataSet>
<CGShows>
<RegionalID>Boston</RegionalID>
<SeqNbr>1</SeqNbr>
<ShowName>Boston IA Prelims</ShowName>
<ShowDate>2005-02-05T00:00:00.0000000-07:00</ShowDate>
<Type>SC</Type>
<PorF>P</PorF>
<RoundNbr>0</RoundNbr>
<Eqp1Judge>ADAMO S</Eqp1Judge>
<Mov1Judge>ADAMS R</Mov1Judge>
<Ens1Judge>O'MELIA K</Ens1Judge>
<GE1Judge>ANDERSON M</GE1Judge>
<GE2Judge>CASTEEN D</GE2Judge>
<TaPJudge>CONNELL R</TaPJudge>
<PerfSched>
<RegionalID>Boston</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>2005-02-05T09:00:00.0000000-07:00</PerfTime>
<UnitID>2104</UnitID>
<Nickname>All Saints</Nickname>
<Class>IA</Class>
</PerfSched>
<PerfSched>
<RegionalID>Boston</RegionalID>
<SeqNbr>1</SeqNbr>
<PerfTime>2005-02-05T09:08:00.0000000-07:00</PerfTime>
<UnitID>2123</UnitID>
<Nickname>Phantom Brig. </Nickname>
<Class>IA</Class>
</PerfSched>
</CGShows>
<CGShows>
<RegionalID>Boston</RegionalID>
<SeqNbr>2</SeqNbr>
<ShowName>Open Prelims</ShowName>
...... etc ........
</CGShows>
</NewDataSet>