you can use ReadToFollowing ("Item") to jump to each Item - however, you need
to be careful, as the "intuitive" code might be (IIRC) wrong:
while(reader.Re adToFollowing(" Item")) {
string content = reader.ReadElem entContentAsStr ing();
// do something with content
}
The reason this is wrong is that ReadElementCont entAsString progresses
/past/ the [Item] element, so the next call to ReadToFollowing () might skip
the next row; you might be able-to do something with a sub-reader, else you
might need to check (after calling ReadElementCont entAsString) if you are on
an Item element; if you are, it is the *next* one, so read it; if you
aren't, then ReadToFollowing
Marc
"CodeRazor" <Co*******@disc ussions.microso ft.com> wrote in message
news:C1******** *************** ***********@mic rosoft.com...
I am reading an xml file from a URL. I was originally doing this using the
XmlDocument class. But this was very slow. The XmlTextReader is meant to
be
much quicker for forward only retrieval of data.
I need to somehow access a particular list of nodes. e.g. I want to loop
through all the nodes called <item></item>. How is this possible using
XmlTextReader?
I can see that you can get the .Value property of XmlTextReader. But I
want
to be able to specify the node I want to look at.
e.g.
<Group>
<Items>
<Item>content here</Item>
<Item>some more content here</Item>
<Items>
<Activity></Activity>
<Location></Location>
</Group>
thanks.
CR