HighTechTalks DotNet Forums  

Check for well formedness and get all errors

Dotnet XML microsoft.public.dotnet.xml


Discuss Check for well formedness and get all errors in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
eliasen
 
Posts: n/a

Default Check for well formedness and get all errors - 08-21-2007 , 03:17 AM






Hi

I would like to run through an XML file using C# 2.0 and check for
well formedness - and I would like to get all errors and not jsut the
first one.

My code is, off course, very simple:
XmlTextReader xtr = new XmlTextReader(xmlInstanceTextBox.Text);
try
{
while (xtr.Read())
{}
}
catch (Exception e)
{
errors += e.Message;
}
finally
{
xtr.Close();
}

When doing a validating reader, I can get an event everytime an
exception occurs, and keep running. But this one... it seems that
there is now way?

Any thouhgts?

Thanks in advance!


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.