Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / May 2005

Tip: Looking for answers? Try searching our database.

Reset XmlValidatingReader

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
oskar - 23 May 2005 10:12 GMT
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]
> //...
> };

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.