Overview#
Notes on programs for formatting XML strings in Python.
Program 1#
I referenced the following.
https://hawk-tech-blog.com/python-learn-prettyprint-xml/
I added processing to remove unnecessary blank lines.
Program 2#
I referenced the following.
https://qiita.com/hrys1152/items/a87b4ca3c74ec4997f66
When processing TEI/XML, I recommend registering the namespace.
Summary#
I hope this serves as a useful reference.