TinyXML - Get Tag Name

Started by
0 comments, last by NumberXaero 12 years, 7 months ago
My XML is something like:

<Object>
<Transform x=0 y=0></Transform>
<Physics accel=1></Physics>
</Object>

What I can't figure out is how to get the name of tags "Transform" & "Physics" using the TiXmlElement and this code:




TiXmlElement * element;
TiXmlNode * iter;

TiXmlDocument xml = TiXmlDocument(strFileName);
xml.LoadFile();

iter = xml.FirstChild( "Object" );

for( iter; iter; iter = iter->NextSibling())
{
element = iter->FirstChildElement();

Debug::PrintF("%s\n", element->WHATGOESHERE?);
}




Should print "Transform" and then "Physics"

...much obliged
blink.gif
Advertisement
Value() or GetValue() cant remember which. Thats for element types, it returns something else if its a comment or text node I think.

This topic is closed to new replies.

Advertisement