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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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?
I like the idea :)