How to get a list of XSD errors in vbscript

Alypse

New Member
I am trying to validate a XML document against a XSD in VBScript. What happens is that I only retrieve the first error it encounters, but I would like to find a way to assemble all errors found by the XSD validation.Is this possible? I saw there is something like a ValidationEventHandler but I am not sure if this also exists in old ASP / VBScript.Thanks for your help! Find a part of my code below:\[code\]' Load XSDDim xsdDocumentSet xsdDocument = Server.CreateObject("Msxml2.DOMDocument.6.0")call xsdDocument.loadXml(getMyXSD())Dim xsdCacheSet xsdCache = CreateObject ("Msxml2.XMLSchemaCache.6.0")xsdCache.add "", xsdDocumentSet XmlDocument = Server.CreateObject("Msxml2.DOMDocument.6.0")XmlDocument.async = falseXmlDocument.preserveWhiteSpace = trueXmlDocument.validateOnParse = falseset XmlDocument.schemas = xsdCacheXmlDocument.resolveExternals = trueXmlDocument.loadXML(xmlString)if XmlDocument.parseError.errorCode <> 0 Then 'Found an error here, but I want to have all errors!end if\[/code\]
 
Back
Top