1 #!/usr/bin/env python 2 3 import libxml2dom 4 import libxml2 5 from xml.dom.ext import PrettyPrint 6 import sys 7 8 doc = libxml2.parseFile(sys.argv[1]) 9 10 #doc = libxml2.parseDoc("""<?xml version="1.0" encoding="iso-8859-15"?> 11 #<schema xmlns="http://www.boddie.org.uk/ns/xmltools/model" 12 # xmlns:database="http://www.boddie.org.uk/ns/xmltools/database"> 13 # 14 # <def-element name="cage" database:table="CAGE"/> 15 #</schema> 16 #""") 17 18 d = libxml2dom.Node(doc) 19 PrettyPrint(d) 20 21 # vim: tabstop=4 expandtab shiftwidth=4