I'm pretty new to RapidXML. I want to construct an Xml document and print it to a file. Everything works but I'm not sure if I'm doing one part of the process right:
Adding an attribute to a node that is a double.
I'm using std c++ stuff:
double value = 1.0;
std::ostringstream strs;
strs << value ;
std::string str = strs.str();
char* numBuff = doc.allocate_string(str.c_str());
xml_attribute<> *attr = doc.allocate_attribute("name",numBuff);
nodeRef->append_attribute(attr);
Is there a more elegnat/faster way? Something like (wishfull thinking):
double value = 1.0;
char* numBuff = doc.allocate_string_from_value(value);
xml_attribute<> *attr = doc.allocate_attribute("name",numBuff);
I need to save tons of doubles into my xml file so performance is my key concern here.
Greetings, Oliver