<Android>
<301 name="yh" qq="2788">
<sdk>11</sdk>
<native>11</native>
</301>
<302>
<sdk>22</sdk>
<native>22</native>
</302>
</Android>
// C++
#include "tinyxml2/tinyxml2.h"
using namespace tinyxml2;
XMLDocument* myDocment = new XMLDocument();
myDocment->LoadFile("config.xml");
XMLElement* rootElement = myDocment->RootElement();
XMLElement* pid = rootElement->FirstChildElement();
while (pid) {
log(pid->Name());
XMLElement* element = pid->FirstChildElement();
const XMLAttribute *attr = pid->FirstAttribute();
while (attr) {
log(attr->Name());
log(attr->Value());
attr = attr->Next();
}
while (element) {
log(element->Name());
log(element->GetText());
element = element->NextSiblingElement();
}
log("\n\n");
pid = pid->NextSiblingElement();
}
<301 name="yh" qq="2788">
<sdk>11</sdk>
<native>11</native>
</301>
<302>
<sdk>22</sdk>
<native>22</native>
</302>
</Android>
// C++
#include "tinyxml2/tinyxml2.h"
using namespace tinyxml2;
XMLDocument* myDocment = new XMLDocument();
myDocment->LoadFile("config.xml");
XMLElement* rootElement = myDocment->RootElement();
XMLElement* pid = rootElement->FirstChildElement();
while (pid) {
log(pid->Name());
XMLElement* element = pid->FirstChildElement();
const XMLAttribute *attr = pid->FirstAttribute();
while (attr) {
log(attr->Name());
log(attr->Value());
attr = attr->Next();
}
while (element) {
log(element->Name());
log(element->GetText());
element = element->NextSiblingElement();
}
log("\n\n");
pid = pid->NextSiblingElement();
}