XmlElement request: toString()


Hopefully simple request for the XmlElement class: Can we have a toString() method that returns the whole element (with sub elements) as a String? This would be extremely helpful while debugging. It would be even better if it was “pretty printed.”




already there! except it’s called “createDocument”

I tend to use a macro for debugging XML content at various points to make it easier. Something like this…

#define DBGXML(xml,msg) DBG(msg);\
#define DBGXML(xml,msg)

… then you can just put DBGXML(pXmlElement,T(“some reminder of what you’re testing”)); and it will be filtered out in a release build. [mind you, the DBGs would be filtered out anyway, so you probably don’t need to bother putting it in preprocessor conditionals. I think the one i used was actually a little different, but this is basically the same.

this was from memory though, it might not work out of the tin!