Показать сообщение отдельно
Старый 17.10.2013, 16:09   #28  
plumbum is offline
plumbum
Участник
Соотечественники
 
182 / 86 (3) ++++
Регистрация: 07.12.2007
Адрес: Vienna, AT
Прочитав 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();
}
__________________
http://www.axdevposts.blogspot.com
Пришел, уведел.... отойди, дай другому увидеть!