Hello, I’m trying to load a content from a XML file (It is my game score database), update some content then save it in archive again.
All is almost right.
First of all I set these two global variables:
XMLFile@ baseXMLFile;
XMLElement baseXMLElement;
then initialize it:
baseXMLFile = cache.GetResource("XMLFile", "base.xml");
baseXMLElement = baseXMLFile.root;
I use the XMLElement methods to modify the content, all right, but only not SetValue(const String&)
when a try to save:
File file;
file.Open("base.xml", FILE_READWRITE);
baseXMLElement.file.Save(file);
My initial file was (base.xml)
[code]<?xml version="1.0"?>
Charles Xavier Thor [/code]After save:
[code]<?xml version="1.0"?>
Charles Xavier Thor aj alves Thor [/code]What is going wrong, why can not I change the XMLElement value?
Is there a best approach to open/update/save files?