Created
April 25, 2018 13:15
-
-
Save Citillara/54464c9d67c097fdb4f321172fa6bfd7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if WScript.Arguments.Count = 0 then | |
WScript.Echo "Missing parameters" | |
else | |
Set xmlDoc = _ | |
CreateObject("Microsoft.XMLDOM") | |
xmlDoc.Async = "False" | |
xmlDoc.Load(WScript.Arguments(0)) | |
Select Case xmlDoc.parseError.errorCode | |
Case 0 | |
WScript.Echo "Valid" | |
Case Else | |
WScript.Echo "ERROR! Failed to validate" &_ | |
WScript.Arguments(0) & vbCrLf & xmlDoc.parseError.reason & vbCr & _ | |
"Error code: " & xmlDoc.parseError.errorCode & ", Line: " & _ | |
xmlDoc.parseError.line & ", Character: " & _ | |
xmlDoc.parseError.linepos & ", Source: " & _ | |
Chr(34) & xmlDoc.parseError.srcText & _ | |
Chr(34) & " - " & Now & vbCrLf | |
End Select | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment