如何在TinyXML中获取标签的名称?

Tra*_*isG 3 c++ xml tinyxml

例如:

的test.xml

<fruit taste="good">whatever</fruit>
Run Code Online (Sandbox Code Playgroud)

如何使用TinyXML获取标签"fruit"的名称字符串(当然是"水果")?

Sam*_*Sam 11

使用TiXmlElement :: Value()

Value函数根据类型返回不同的东西.

    Document:   filename of the xml file
    Element:    name of the element
    Comment:    the comment text
    Unknown:    the tag contents
    Text:       the text string
Run Code Online (Sandbox Code Playgroud)