Following somebody’s helpful advice I have for years used this line of code to write out a file:
tree.write(newname, encoding=tree.docinfo.encoding,, xml_declaration=True, pretty_print=True) When running a script in Pycharm, its AI suggested just “tree.write(newname)” . I used the simpler form for a document, and it seemed to make no difference to the structure or display of the document. It’s a lot less to type and certainly easier to remember. Does the specification of features ever make a difference? Martin Mueller Professor emeritus of English and Classics Northwestern University
_______________________________________________ lxml - The Python XML Toolkit mailing list -- lxml@python.org To unsubscribe send an email to lxml-le...@python.org https://mail.python.org/mailman3/lists/lxml.python.org/ Member address: arch...@mail-archive.com