Menu

#49 Wrong output format

open
nobody
None
5
2010-04-02
2010-04-02
No

Valid XML code for an element with empty content type (an element without child elements) are:
<elementname/>
or
<elementname></elementname>
(with no space inbetween) but not
<elementname>
</elementname>
because of the character content (Text-Node) consisting of spaces and/or linefeeds between the start and end tag.
This is correctly done by TinyXML on e.g. a SaveFile(...) action!

But if a comment or processing instruction is added as a child of elementname the following incorrect XML code in exported (it dose not validate by an XML schema parser if elementname is defined as empty content):
<elementname>
<!-- mycomment -->
</elementname>
The correct XML code must be:
<elementname><!-- mycomment --></elementname>
without any whitespace or linefeeds inbetween.

The attached patch fixes this bug.

Discussion

  • Markus Friedrich

    Patch for TinyXML versoin 2.6.1

     
  • Dirk Jagdmann

    Dirk Jagdmann - 2012-01-10

    this patch is applied in 2.6.2

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.