vb.net Code:
  1. Try
  2.    Dim x As New XmlDocument
  3.    x.LoadXml(myxml) ' if myxml contains invalid xml at this point then ....
  4.  
  5. ' it goes straight to
  6.  
  7. Catch ex As XmlException
  8.    MessageBoxEx.Show(ex.Message.ToString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
  9. End Try
  10.  
  11. ' without passing Go, without collecting 200 currency units, and leaving x as an empty document
  12.  
  13. ' it never validates according to schema only by the default xml standard
  14. ' and as there is no location information in this error message .... !