Menu

#14 Select an Empty Tag Style

open
nobody
None
5
2004-08-10
2004-08-09
No

This patch is relative to TinyXml 2.3.2

The accepted form for XML empty tags is <Foo/>.
However, an empty tag is sometimes represented as
<Foo></Foo>. (An example is an XML document which may
be edited to add content to a tag later.) While
tinyxml will read either form, output originally was
only of the form <Foo/>.

This patch allows setting the new repetitiveEmptyTag
element of class TiXmlBase, which switches to the
<Foo></Foo> output form from the default <Foo />. In
the spirit of condenseWhiteSpace, two inline functions
are implemented in TiXmlBase:
static void SetRepetitiveEmptyTag( bool repetitive );
and
static bool IsRepetitiveEmptyTag();

Discussion

  • Scott Wagner

    Scott Wagner - 2004-08-10
    • summary: Output empty tags as "<Foo></Foo>" --> Select an Empty Tag Style
     
  • Scott Wagner

    Scott Wagner - 2004-08-10

    Logged In: YES
    user_id=334851

    Upon further investigation, the repetitiveEmptyTag idea does
    not do the whole job - and it is confusing. So, perhaps
    it's done right this time ... the new scheme allows setting
    a TiXmlEmptyTagStyle as one of:
    TIXML_EMPTY_TAG_TRAILING_SLASH: The traditional way, <Foo/>
    TIXML_EMPTY_TAG_OPEN_CLOSE: Repeated style for all, <Foo></Foo>
    TIXML_EMPTY_TAG_OPEN_CLOSE_NO_ATTRIB: Repeated style only
    for tags with no attributes, <Foo></Foo>, but <Fee fie="foe"/>

     
  • Scott Wagner

    Scott Wagner - 2004-08-10

    TiXmlEmptyTagStyle patch to v2.3.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.