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! |