QDomDocument doc("TextSymbols");
QFile file("xxx.xml");
if (!file.open(QIODevice::ReadOnly))
{
return;
}
if (!doc.setContent(&file))
{
file.close();
return;
}
file.close();
QDomNodeList nodeList = doc.elementsByTagName("rank_insignia");
QDomNodeList nodeList2;
for (int i = 0 ; i < nodeList.size(); ++i)
{
nodeList2 = nodeList.at(i).childNodes();
nodeList2.at(0).toElement().attribute("entitlement");//你要的东西
}