How do you modify the code below to validate xml files in multiple folders? For example I need to validate NSNBEL.XML in \Data\MasterNSN folder, NSCBEL.xml in \Data\MasterNSN folder, but the .xsd files in the MasterFiles folder does not include the country, for example it contains NSN.xsd, NSC.xsd. Is there a way to but the folders in a string variable and use a loop instead of writing the same code for each folder and country. When I only one to validate for each country at a time not all countries in the folder.
On Error GoTo tt
Dim zz As String = ""
For Each File As String In IO.Directory.GetFiles(Application.StartupPath + "\Data\MasterFuze\")
Dim settings As New XmlReaderSettings
settings.ValidationType = ValidationType.Schema
settings.Schemas.Add(XmlSchema.Read(New XmlTextReader(Application.StartupPath + "\Data\MasterFiles\" & IO.Path.GetFileNameWithoutExtension(File) & ".xsd"), AddressOf ValidationHandler))
Dim reader As XmlReader = XmlReader.Create(File, settings)
zz = File
Dim doc As New XmlDocument()
MsgBox("Master Files Validated")