Как я могу получить имя тега в TinyXML? - PullRequest
3 голосов
/ 16 сентября 2011

Например:

test.xml

<fruit taste="good">whatever</fruit>

Как получить строку имени тега "fruit" (которая, конечно, будет "fruit"), используя TinyXML

1 Ответ

11 голосов
/ 16 сентября 2011

Использование 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
...