How can I read a XML constructions such as this:
<buildings>
<building name="building1" count="3"/>
<building name="building2" count="3"/>
<building name="building3" count="3"/>
</buildings>
I’m trying to read it in this way:
XMLElement buildingsElement = rootEl.GetChild("buildings");
XMLElement currentBuilding = buildingsElement.GetChild("building");
while(currentBuilding)
{
String buildingKey = currentBuilding.GetAttribute("name");
int buildingCount = currentBuilding.GetInt("count");
_buildings.insert(std::pair<String,int>(buildingKey, buildingCount));
currentBuilding = buildingsElement.GetChild("building").NextResult();
}
…but only first “building” line was read. What’s may be wrong with NextResult() usage?