Last active
January 22, 2016 15:20
-
-
Save narate/5e818b844f9a4758b1b1 to your computer and use it in GitHub Desktop.
Pretty XML string
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
#!/usr/bin/env python | |
import sys | |
import xml.dom.minidom | |
data = sys.stdin.read() | |
xml = xml.dom.minidom.parseString(data) | |
print xml.toprettyxml(indent=" ", newl="") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example.