Menu

Alternative empty tag format patch offered

Developer
2004-08-09
2004-08-10
  • Scott Wagner

    Scott Wagner - 2004-08-09

    Hello all,

    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 in v2.3.2 is only of the form <Foo/>.

    I have offered a patch (#1006192) in Patches) which defaults to the preferred <Foo/> form, but which allows the <Foo></Foo> form as well.  Is this a good idea?

    Scott Wagner

     
    • Scott Wagner

      Scott Wagner - 2004-08-10

      The first idea did not do the whole job - and was confusing.  It has been reworked to the concept of "Empty Tag Style", which may be 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"/>
      Is this a better solution?

       
      • Ellers

        Ellers - 2004-08-10

        I like the idea :)

         

Log in to post a comment.

MongoDB Logo MongoDB