AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX: Программирование
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.06.2008, 16:01   #5  
konopello is offline
konopello
SAP
SAP
 
628 / 76 (4) ++++
Регистрация: 08.11.2005
Адрес: Минск
Всем спасибо, проблему решил
X++:
static str OEMToCharBuff(str _strSource)
{
    DLL         winApiDLL = new DLL('USER32');
    DLLFunction OEMToChar = new DLLFunction(winApiDLL, 'OemToCharA');
    Binary      bSource   = new Binary(_strSource);
    str         oemstr;
    ;

    OEMToChar.returns(ExtTypes::DWORD);
    OEMToChar.arg(ExtTypes::POINTER, ExtTypes::POINTER);
    OEMToChar.call(bSource, bSource);
    oemstr = bSource.string(0);

    return oemstr;
}
X++:
static void A000088_WorkXML(Args _args)
{
    TextBuffer                  textBuffer;

    XmlDocument                 xmlDoc;
    XMLNodeList                 tests;
    XMLNode                     node;
    XMLParseError               error;
    XmlProcessingInstruction    xmlProcessingInstruction;

    FileIOPermission    sourceFileReadPerm;

    Filename            sourceFileName = 'C:\\Tmp\\101.xml';

    #define.read('R')
    #define.write('W')
    ;

    // Assert permission to use XML save
    sourceFileReadPerm = new FileIOPermission(sourceFileName, #read);
    sourceFileReadPerm.assert();

    textBuffer = new TextBuffer();
    textBuffer.fromFile(sourceFileName);
    textBuffer.setText(WinApi::OEMToCharBuff(textBuffer.getText())); // А ВОТ И ПЕРЕВОД

    xmlDoc = new XmlDocument();

    if (!xmlDoc.loadXML(textBuffer.getText()))
    {
        error = xmlDoc.parseError();
        info("Error during load of XML: " + error.reason() + " in line " + int2str(error.line()));
        return;
    }

    tests = xmlDoc.selectNodes('//Statements');

    node = tests.nextNode();
    while (node)
    {
        info(node.selectSingleNode('Date').text());
        info(node.selectSingleNode('Account').text());
        node = tests.nextNode();
    }
}
Теги
xml, ax4.0

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dax-lessons: Generate XML Documentation Files for a project - DAX 2009 Blog bot DAX Blogs 0 08.08.2008 19:06
axStart: InfoPath with default AIF file inbound offline Blog bot DAX Blogs 0 20.05.2008 19:05
axStart: How to use XSLT in AIF and what’s wrong with empty xml Nodes. Blog bot DAX Blogs 0 27.04.2008 18:07
Dave: XML File Size limitation using FindList AIF Actions Blog bot DAX Blogs 0 12.04.2007 16:10
Axapta Lessons: Export a table to a file Blog bot DAX Blogs 0 28.10.2006 18:22

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 19:28.