Groups | Blog | Home
all groups > dotnet xml > january 2007 >

dotnet xml : Error recovery when using XMLWriter



greg
1/19/2007 4:14:10 PM
Hi All,

I'm writing data into an XmlTextWritter and I want to able to recover from
an error if it occurs and continue the writing. So far even though I trap
the error any subsequent attempt to write to it, it raises yet another
exception because the writer is in an error state.

Is there a way to reset the WriteState so I can continue writing?

Thanks in advance,
Greg.

Martin Honnen
1/19/2007 7:36:35 PM
[quoted text, click to view]

The documentation
<http://msdn2.microsoft.com/en-us/library/system.xml.writestate.aspx>
suggests that all you can do in an error state is close the reader,
other operations are not possible but throw an InvalidOperationException.



--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button