Save-formatting when using CDATA blocks

  • John

    John - 2010-10-06

    If I have this test code:

        TiXmlElement *parentElem = new TiXmlElement("ParentNode");
        TiXmlElement *newElem = new TiXmlElement("TestNode");
        TiXmlText *textElem = new TiXmlText("Test Content");

    With the line commented I get output XML:

        <TestNode>Test Content</TestNode>
    ]Uncommenting the line I get:
            <![CDATA[Test Content]]>
    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 [i]<TestNode>[/i] is a pain. Is this a controllable part of TinyXml, or a bug, or just the way it is?
  • John

    John - 2010-10-06

    Grr, formatting typo. No editing possible? Hopefully it's still clear.

  • Lee Thomason

    Lee Thomason - 2010-10-06

    That's a bug, albeit a minor one. TiXmlPrinter may work around the problem - it uses a different output path.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks