Created
January 30, 2019 20:35
-
-
Save davidfmiller/d726b6798f71afbb3b836c9ec9283006 to your computer and use it in GitHub Desktop.
XML Pretty Print
This file contains 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
#!/usr/bin/python | |
import xml.dom.minidom | |
import sys | |
input = sys.stdin.read() | |
dom = xml.dom.minidom.parseString(input) | |
pretty_xml_as_string = dom.toprettyxml(indent=' ', newl='\n') | |
print(pretty_xml_as_string) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment