Moving the XmlTextReader.Read() pointer back to the start?
Question posted by: Blink
(Guest)
on
November 11th, 2005 10:50 PM
I'm using the XmlTextReader class to parse an XML feed. I need to search for
elements that may or may not be there; for example, if there was an error
with my request the XML will contain an <error> element. If there was
nothing wrong this element won't be in it. My problem with this is that
after searching through the XML the first time looking for the <error>
element using the XmlTextReader.Read() method, I can't search for any other
element because the Read() pointer is at the end.
Is there anyway to move it back to the beginning so I can search for other
elements? I've tried XmlTextReader.MoveToElement("startElement") and
XmlTextReader.ResetState() but these don't do what I want them to.
Any ideas? Failing that, can anyone suggest any other reasonably efficient
way to read the XML that provides recordset-like navigation?
TIA.
0
Answers Posted
|
|
|
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 196,840 network members.
Top Community Contributors
|