Last active
December 12, 2022 15:37
-
-
Save rspivak/74a08170a2a04a344161 to your computer and use it in GitHub Desktop.
Pretty print XML with lxml - one liner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ alias ppxml='python -c "import sys,StringIO;from lxml import etree;print(etree.tostring(etree.parse(StringIO.StringIO(sys.stdin.read()), etree.XMLParser(remove_blank_text=True)), pretty_print=True))"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've updated your one liner to python3