OK, so you know how to load the file:
XMLDocument file;
file.LoadFile("file.xml");
We do not know the syntax of your XML file. But you have to walk down throw the elements.
XMLElement *pDog = file.FirstChildElement("dog");
if(pDog != null)
{
if(pDog->Attribute("colour") == "brown)
{
pDog->SetText("Waow!");
}
}
file.SaveFile("...");
As I mentioned, you have to parse the elements through to get to the correct node.
The online readme file also states:
Lookup information.
/* ------ Example 2: Lookup information. ---- */
{
XMLDocument doc;
doc.LoadFile( "dream.xml" );
// Structure of the XML file:
// - Element "PLAY" the root Element, which is the
// FirstChildElement of the Document
// - - Element "TITLE" child of the root PLAY Element
// - - - Text child of the TITLE Element
// Navigate to the title, using the convenience function,
// with a dangerous lack of error checking.
const char* title = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->GetText();
printf( "Name of play (1): %s\n", title );
// Text is just another Node to TinyXML-2. The more
// general way to get to the XMLText:
XMLText* textNode = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->FirstChild()->ToText();
title = textNode->Value();
printf( "Name of play (2): %s\n", title );
}