Hello,
How do I reset an XmlValidatingReader or move it back to it's starting
position?
// First time, works fine
while( vr.Read() )
{
//...
};
// Second time, doesn't read anything since it's at the end of the stream
while( vr.Read() )
{
//...
};
Michael Jervis - 23 May 2005 11:15 GMT
I'm using an XmlTextReader based on a filestream, but to reset it I do:
/* Reset the reader to the start: */
fs.Position = 0;
reader = new XmlTextReader(fs);
ResetState doesn't appear to reset the state. To re-read the file you
need to position back to the start and start again it seems.
Zafar Abbas [MSFT] - 24 May 2005 18:25 GMT
XmlValidatingReader is a forward only reader. To re-read content you need to
either.
1. you need to construct a new reader
2. Load the document in a XmlDocument and navigate it back and forth using
an XPathNavigator.
Thanks
> Hello,
>
[quoted text clipped - 12 lines]
> //...
> };