Author: Copyright 2011, MetaQuotes Software Corp.
0 Views
0 Downloads
0 Favorites
XML_test
//+------------------------------------------------------------------+
//|                                                     XML_test.mq5 |
//|                        Copyright 2011, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"

#include <Xml\XmlBase.mqh>

CXmlDocument doc;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   string file="File.xml";
   string err;
   if(doc.CreateFromText(file,err))
     {
      CXmlElement*xmlItem=doc.FDocumentElement.GetChild(0);
      for(int i=0; i<xmlItem.GetChildCount(); i++)
         if(xmlItem.GetChild(i).GetName()=="LAYER")
           {
            CXmlElement *layer=xmlItem.GetChild(i);
            for(int j=0; j<layer.GetChildCount();++j)
              {
               if(layer.GetChild(j).GetName()=="NEURON")
                 {
                  /* .... */
                 }
              }
           }
     }
  }
//+------------------------------------------------------------------+

Comments