Показать сообщение отдельно
Старый 21.08.2012, 14:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
axblog4u: Reading Selected Node in XML – Dynamics AX2012
Источник: http://axblog4u.wordpress.com/2012/0...namics-ax2012/
==============

Case Study: Below a sample job is illustrated to read selected (multiple) nodes from a given XML.



X++:
private static void SR_ReadSelectedNode_XML(Filename fileName)
{
    #define.node('INFORMATION//ROWS/ROW')
    XmlDocument xmlDocument;
    XmlNode     xmlInformationNode;
    XmlNodeList xmlInformationsNodeList;
    XmlNodeList xmlChildNodeList;
    int         i;
    int         j;

    fileName                = @'C:\Projects\ReadNode.xml';
    xmlDocument             = xmlDocument::newFile(fileName);
    xmlInformationsNodeList = xmlDocument.documentElement()
                                         .selectNodes(#node);
    
    setPrefix("@SYS98689");

    for ( i = 0; i < xmlInformationsNodeList.length(); i++)
    {
        xmlChildNodeList = xmlInformationsNodeList.item(i)
                                                  .childNodes();
        
        for (j = 0; j < xmlChildNodeList.length() ; j++) 
        {
            xmlInformationNode = xmlChildNodeList.item(j);

            if (xmlInformationNode.baseName() == 'DETAILS')
            {
                info(xmlInformationNode.innerXml());
                break;
            }
        }        
    }
}



Источник: http://axblog4u.wordpress.com/2012/0...namics-ax2012/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Poleax; 21.08.2012 в 14:42.