Прочитав MSDN я понял, что вам и валидацию вызывать не надо:
http://msdn.microsoft.com/en-us/libr...t.loadxml.aspx
http://msdn.microsoft.com/en-us/library/875kz807.aspx
Цитата:
XmlException. There is a load or parse error in the XML. In this case, the document remains empty.
просто проверьте потом тип исключения на XmlException (вхождение в строку текста исключения например)
Приведу общий код обработки исключений для .NET в AX:
X++:
try
{
lclsInteropPerm = new InteropPermission(InteropKind::ClrInterop);
lclsInteropPerm.assert();
....
CodeAccessPermission::revertAssert();
}
catch (Exception::CLRError)
{
this.processCLRException();
CodeAccessPermission::revertAssert();
}
X++:
protected void processCLRException()
{
System.Exception lclsNetException;
str lstrExceptionMessage, lstrErrorMessage;
InteropPermission lclsInteropPerm = new InteropPermission(InteropKind::ClrInterop);
lclsInteropPerm.assert();
lclsNetException = CLRInterop::getLastException();
while (! CLRInterop::isNull(lclsNetException))
{
lstrExceptionMessage = lclsNetException.get_Message();
lstrErrorMessage += lstrErrorMessage
? "\n" + lstrExceptionMessage
: lstrExceptionMessage;
lclsNetException = lclsNetException.get_InnerException();
}
CodeAccessPermission::revertAssert();
}