Can TinyXml load Xml from string instead of file?

user339996 picture user339996 · May 19, 2010 · Viewed 13.9k times · Source

I'm using TinyXml library for my application but TiXmlDocument object just only can load Xml file. How can it load Xml from string. Could you tell me the way to do this. Thank you very much

Tu.

Answer

volody picture volody · May 19, 2010

Instead of calling TiXmlDocument::LoadFile() you can use TiXmlDocument::Parse()

TiXmlDocument doc;
doc.Parse((const char*)filedata, 0, TIXML_ENCODING_UTF8);

Check DotScene Loader with User Data Class