Windows2003-3790/tools/postbuildscripts/checkxml.js
2020-09-30 16:53:55 +02:00

31 lines
653 B
JavaScript

xmlDoc = new ActiveXObject( "Msxml2.DOMDocument" );
try
{
res = xmlDoc.load( WScript.Arguments(0) );
}
catch(e)
{
res = false;
}
if(res != true)
{
WScript.Echo( "Bad xml "+
WScript.Arguments(0)+
"!!\n");
err = xmlDoc.parseError;
WScript.Echo( "reason : " + err.reason );
WScript.Echo( "line : " + err.line );
WScript.Echo( "linepos: " + err.linepos );
WScript.Echo( "filepos: " + err.filepos + "\n" );
WScript.Echo( err.srcText.substr( err.linepos - 10, 60 ) );
WScript.Echo( "---------^" );
}