If I have this test code:
TiXmlElement *parentElem = new TiXmlElement("ParentNode");
TiXmlElement *newElem = new TiXmlElement("TestNode");
TiXmlText *textElem = new TiXmlText("Test Content");
//textElem->SetCDATA(true);
newElem->LinkEndChild(textElem);
parentElem->LinkEndChild(newElem);
With the line commented I get output XML:
<ParentNode>
<TestNode>Test Content</TestNode>
</ParentNode>
Uncommenting the line I get:
<ParentNode>
<TestNode>
<![CDATA[Test Content]]>
</TestNode>
</ParentNode>
Now ideally it would still all be one line, but I don't really mind it putting the CDATA content nested... but the fact indentation is screwed up on the closing <TestNode>
is a pain. Is this a controllable part of TinyXml, or a bug, or just the way it is?