' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Set xsd = CreateObject("MSXML2.XMLSchemaCache.6.0")
xsd.Add "", "val.xsd"
Set xml = CreateObject("MSXML2.FreeThreadedDOMDocument.6.0")
xml.Async = False
xml.validateOnParse = True
xml.schemas = xsd
xml.Load("val.xml")
If xml.parseError.errorCode = 0 Then
   WScript.Echo "OK"
Else
   WScript.Echo "Error"
End If
Set xml = Nothing
Set xsd = Nothing
