Select an Empty Tag Style
Brought to you by:
leethomason
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();
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"/>
TiXmlEmptyTagStyle patch to v2.3.2