You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-10-01.08:04:49.618>created_at=<Date2017-08-22.08:01:08.489>labels= ['expert-XML', 'type-feature', '3.8']
title='xml.etree.ElementTree: add support for doctype in tostring method'updated_at=<Date2021-08-15.22:46:41.105>user='https://bugs.python.org/bastik'
When trying to generate an XML file with 'xml.etree.ElementTree', there is no way to specify a doctype (example below).
The 'xml.etree.ElementTree.ElementTree.write' method has a 'xml_declaration' flag, which can be used as workaround, but there is no such flag for 'xml.etree.ElementTree.tostring' (and it is not always desirable to write the XML document directly to file). Please compare the corresponding flags in lxml.
Here is an example for a document I would like to generate and convert to string:
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: