martinblech / xmltodict

Python module that makes working with XML feel like you are working with JSON
MIT License
5.52k stars 462 forks source link

[Feature request] Add option to omit XML header when unparsing #318

Open mrmeszaros opened 1 year ago

mrmeszaros commented 1 year ago

unparse always creates an XML header <?xml version="1.0" encoding="utf-8"?>, I would like the option to omit it.

mpf82 commented 1 year ago

That option already exists.

Here are the params of unparse and their default values:

def unparse(input_dict, output=None, encoding='utf-8', full_document=True,
        short_empty_elements=False,
        **kwargs):

Simply set full_document=False.

mrmeszaros commented 1 year ago

Thanks! Could You please extend the docstring to explain what the param does?