I’m using an xml file as a database for saving and loading settings and things. I also allow for deleting saved settings. My XML structure is essentially this.
Anyhow all is well in the world with saving loading etc. I’m using this bit of code to erase out a saved setting.
int numSaveTags = XML.getNumTags("SAVE");
if (numSaveTags > 0) {
for (int i=0; i<numSaveTags; i++) {
XML.pushTag("SAVE", i);
string name = XML.getValue("NAME", "none", 0);
if (name == saveMenu.name) {
XML.clear();
}
XML.popTag();
}
}
//save it
XML.saveFile( ofxiPhoneGetDocumentsDirectory() + "mySaves.xml" );
This works just fine, clears everything out of the file. Except and odd little leftover . Unfortunately then my list of saved settings gets wonky because
int numSaveTags = XML.getNumTags(“SAVE”);
will still pick up that leftover .
Any ideas on how to get rid of the weird left over after .clear()?