tinyxml c++ attribute not found



I have a problem with my code.



XMLDocument doc;
doc.LoadFile("data.xml");

XMLElement *all = doc.FirstChildElement("VOLNAMISTA")->FirstChildElement("VOLNEMISTO");

int i = 0;
for (all; all; all = all->NextSiblingElement())
{
prvek[i].ID = all->Attribute("uid");
cout << prvek[i].ID << endl;
i++;
}


actually code working fine ! but sometimes in xml file happend that attribute "uid" miss ! and when it happend program stop work with error ... any help please ? :)


No comments:

Post a Comment