Skip to content

Instantly share code, notes, and snippets.

@adojos
Last active March 9, 2023 11:02
Show Gist options
  • Save adojos/f91c0fade26be87d933d8fc34e7ce7ef to your computer and use it in GitHub Desktop.
Save adojos/f91c0fade26be87d933d8fc34e7ce7ef to your computer and use it in GitHub Desktop.
VBS: Parse XML Errors on Loading #vbs
' This ParseError property is for errors and warnings during 'Load'method.
' Applies to IXMLDOMParseError interface.
Public Function ParseLoadErrors (ByVal ObjParseErr)
Dim strResult
strResult = vbCrLf & "<ERROR> INVALID XML! FAILED WELL-FORMED (STRUCTURE) CHECK ! " & _
vbCrLf & ObjParseErr.reason & vbCr & _
"Error Code: " & ObjParseErr.errorCode & ", Line: " & _
ObjParseErr.Line & ", Character: " & _
ObjParseErr.linepos & ", Source: " & _
Chr(34) & ObjParseErr.srcText & _
Chr(34) & " - " & vbCrLf & _
vbCrLf & "CORRECT THE FILE BEFORE CONTINUING XSD VALIDATION !" & vbCrLf
ConsoleOutput "Log File : " & strLogPath, "verbose", LogHandle
ConsoleOutput "", "verbose", LogHandle
ConsoleOutput strResult, "verbose", LogHandle
ParseLoadErrors = False
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment