2011-09-16 72 views

回答

10

使用TiXmlElement::Value()

价值函数根据类型不同的事情。

Document: filename of the xml file 
    Element: name of the element 
    Comment: the comment text 
    Unknown: the tag contents 
    Text:  the text string 
+1

忘了提,如果使用STL,你也可以使用[TiXmlNode :: ValueStr()](http://www.grinninglizard.com/tinyxmldocs/classTiXmlNode.html#74bda074919e4a5e08d700204793f898),返回' const std:string&'而不是'const char *'。它也更高效。 – Sam