Can I get at the string data using any of the ofxXmlSettings calls?
Calling XML.tagExists(“XmlExchange:label:a”); on the file returns true, but I can’t get XML.getValue(“XmlExchange:label:a”, “bah”); to return anything, despite trying a variety of permutations.
I’m not sure what to do about the “name=”, “type=”, “string=” parts of the tags.
Maybe I just have to read/write to the xml file like a text file? But I’m hoping to avoid that.
If I do the following, fexists returns true, so I think I have the tag syntax right:
bool fexists=0;
fexists = XML.tagExists("XmlExchange:label:a");
if(fexists)printf("found tag \n");
but, if I do this, the value of my xmlstring var is NULL?
string xmlstring;
xmlstring=XML.getAttribute("XmlExchange:label:a", "string", "bah");
printf("value is %s\n",xmlstring);
I’ve tried replacing the “string” with “string=”, and looking at the attributes of the outer tag: XML.getAttribute(“XMLExchange:label”, “name”, “bah”) but still to no avail?
I even tried to print directly in case there was something going on with my string variable:
printf(“value is %s\n”, XML.getAttribute(“XmlExchange:label:a”, “string”, “bah”));
You really don’t need to use c strings very often. printf() is the only time I ever do, but for the most part you can use c++ strings the same as strings in other (friendlier-ish) languages.