I'm trying to read content within tags, but I'm not succeeding.
Here's what I'm trying:
int main()
{
TiXmlDocument *doc = new TiXmlDocument("simple-scene.xml");
doc->LoadFile();
cout << doc->FirstChildElement("width")->GetText();
return 0;
}
Here's the XML document:
<?xml version="1.0" encoding="utf-8"?>
<rt>
<image>
<width>800</width>
<height>600</height>
</image>
</rt>
Any help is appreciated!
You have to access from root element to the child elements such as this sample: