tinyxml的用法和实例 (二)

2014-11-24 01:41:29 · 作者: · 浏览: 3
ent = pElement->FirstAttribute();
while(attributeOfStudent)
{
PrintTree(i);
std::cout << attributeOfStudent->Name() << " : " << attributeOfStudent->Value()< attributeOfStudent = attributeOfStudent->Next();
}
TiXmlElement* ChildElement = pElement->FirstChildElement();
while(NULL != ChildElement)
{
i++;
ParseXML(ChildElement);
i--;
ChildElement = ChildElement->NextSiblingElement();
}
}

例如要解析的文件内容是

< xml version="1.0" encoding="utf-8" >




88208888
on the ground


Road1



88206666
Road2



few teatchers