Adrian wrote:
> Hi
> I have a text box where I can paste XML docs into and then send them
> however sometimes the call fails I assume to incorrectly formatted text! it
> fails on the line below:
>
> doc.LoadXml(txtToSend.Text.ToString)
>
> How can I check if the text constitutes a valid XML xml document before
> loading it?
>
> Thanks
>
>
I think you are checking. Look at the exception that is being thrown,
it probably tells you that your xml is poorly formatted. Catch the
exception and handle it accordingly.
Chris
|