#language = "JScript"
#title=""
#tooltip="Validate XML",1033,"XML の整合性チェック",1041,"Ověřit XML",1029,"XML überprüfen",1031,"Valider XML",1036,"Validar XML",3082,"Validar XML",2058,"Convalida XML",1040,"XML 유효성 검사",1042,"XML Valideren",1043,"验证 XML",2052,"驗證 XML",1028
#icon="validateXML.ico"
// Do not edit this file.  If you want to edit the file, please copy it into another folder.
// This file will be replaced with a newer version every time EmEditor is upgraded.
document.selection.SelectAll();
var x = new ActiveXObject("MSXML2.DOMDocument");
x.async = false;
x.validateOnParse = true;
x.resolveExternals = true;
x.loadXML( document.selection.Text );
document.selection.Collapse();
OutputBar.Clear();
if (x.parseError.errorCode != 0) {
    OutputBar.writeln( document.FullName + "(" + x.parseError.line + "): " + x.parseError.reason );
	OutputBar.Visible = true;
	document.selection.SetActivePoint( eePosLogical, 1, x.parseError.line );
}
else {
	switch( editor.LangID )	{
	case 1041:  // Japanese
	    status = "エラーは見つかりませんでした。";
	    break;

	case 1029:  // Czech
		status = "Nebyly nalezeny žádné chyby.";
		break;

	case 1031:  // German
		status = "Keine Fehler gefunden.";
		break;

	case 1036:  // French
		status = "Aucune erreur détectée.";
		break;
	
	case 3082:  // Spanish
	case 2058:  // Spanish
		status = "No se han encontrado errores.";
		break;

	case 1040:  // Italian
		status = "Non sono stati rilevati errori.";
		break;

	case 1042:  // Korean
		status = "오류가 없습니다.";
		break;

	case 1043:  // Dutch
		status = "Er zijn geen fouten gevonden.";
		break;

	case 2052:  // Simplified Chinese
		status = "找不到错误。";
		break;

	case 1028:  // Traditional Chinese
		status = "找不到錯誤。";
		break;

	case 1033:  // English
	default:
		status = "No errors were found.";
	}
}
// reference:
// MSXML                https://msdn.microsoft.com/en-us/library/ms763742(v=vs.85).aspx
// JScript sample code  https://msdn.microsoft.com/en-us/library/ms767627(v=vs.85).aspx
// loadXML method       https://msdn.microsoft.com/en-us/library/ms754585(v=vs.85).aspx
