This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author adpoliak
Recipients adpoliak
Date 2012-03-21.04:46:24
SpamBayes Score 1.9605226e-09
Marked as misclassified No
Message-id <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za>
In-reply-to
Content
As it stands in Hg, when the write() method of an xml.etree.ElementTree object is called, and a tag within the XML tree has no child tags or defined text, the tag is written using the short notation "<tag ... />".

Whether or not the short notation is used instead of the long "<tag ...></tag>" notation is used should be configurable by the programmer, without having to resort to serializing the XML into a string and then doing replace() on said string.

The attached patch adds an optional parameter to the write() method that provides this choice.
If the 'use_long_xml_tags' parameter is not set (or otherwise evaluates to the boolean False), the current behavior applies.
If this parameter evaluates to the boolean True, long tags are used when producing XML output.
History
Date User Action Args
2012-03-21 04:46:26adpoliaksetrecipients: + adpoliak
2012-03-21 04:46:26adpoliaksetmessageid: <1332305186.87.0.484792091693.issue14377@psf.upfronthosting.co.za>
2012-03-21 04:46:26adpoliaklinkissue14377 messages
2012-03-21 04:46:25adpoliakcreate