#include "stdafx.h"
#include "pugixml.h"
#include "pugiconfig.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
pugi::xml_document doc;
pugi::xml_node rootnode;
if (!doc.load_file("Uces(1).Xml"))
{
return 0;
}
rootnode = doc.child("Ecus");
//string stRank;
for (pugi::xml_node_iterator ait=rootnode.begin(); ait!=rootnode.end(); ait++)
{
string stRank;
string strEcuName = ait->attribute("name").value();
pugi::xml_node itidsnode = ait->child("ECUInformations").child("Ids");
pugi::xml_node_iterator itidsbegin = itidsnode.begin();
pugi::xml_node_iterator itidsend = itidsnode.end();
while (itidsbegin != itidsend)
{
string str = itidsbegin->name();
if (str == "IdByte")
{
stRank = itidsbegin->attribute("value").value();
}
itidsbegin++;
}
}
return 0;
}
#include "pugixml.h"
#include "pugiconfig.h"
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
pugi::xml_document doc;
pugi::xml_node rootnode;
if (!doc.load_file("Uces(1).Xml"))
{
return 0;
}
rootnode = doc.child("Ecus");
//string stRank;
for (pugi::xml_node_iterator ait=rootnode.begin(); ait!=rootnode.end(); ait++)
{
string stRank;
string strEcuName = ait->attribute("name").value();
pugi::xml_node itidsnode = ait->child("ECUInformations").child("Ids");
pugi::xml_node_iterator itidsbegin = itidsnode.begin();
pugi::xml_node_iterator itidsend = itidsnode.end();
while (itidsbegin != itidsend)
{
string str = itidsbegin->name();
if (str == "IdByte")
{
stRank = itidsbegin->attribute("value").value();
}
itidsbegin++;
}
}
return 0;
}