I have a VB.Net program that processes XML files from a selected folder. The problem is I receive an error if the program gets to an XML file that is not valid because of bad formatting (i.e. no matching end tag). In these cases I would just like to skip that file and move on in the code. Here is where the error occurs and process stops:
XmlDocument.Load(XMLFile)
Does anyone know how I can either test if the file is a valid XML file before loading or I can put an error handle around the loading so my program does not stop if such a file is encountered? Thanks!