如何获取标签之间的内容
<name> </name> and <mode> </mode>
<news>
<name>Enter</name>
<actions>
<mode>me</mode>
</actions>
</news>
\ 这
TiXmlDocument doc("tes.xml");
if (doc.LoadFile())
{
TiXmlHandle hDoc(&doc);
TiXmlText* text = hDoc.ChildElement("news", 0).ChildElement("act-news", 0).ChildElement("name", 0).FirstChild().Text();
if(text)
{
const char* message = text->Value();
cout<<(message)<<endl;
}
TiXmlText* stext = hDoc.ChildElement("news", 0).ChildElement("act-news", 1).ChildElement("name", 0).FirstChild().Text();
if(text)
{
const char* message = stext->Value();
cout<<(message)<<endl;