2014-01-28 | Paul Boddie | raw annotate files changeset graph | Remove spurious error conditions before parsing, perhaps caused by other users of libxml2 in an Apache environment. |
1 #!/usr/bin/env python 2 3 import libxml2dom 4 import sys 5 6 d = libxml2dom.parse(sys.argv[1]) 7 8 print "Prettyprint using libxml2dom..." 9 print 10 11 d.toStream(sys.stdout, prettyprint=1) 12 13 try: 14 from xml.dom.ext import PrettyPrint 15 16 print "Prettyprint using xml.dom..." 17 print 18 19 PrettyPrint(d) 20 21 except ImportError: 22 print "xml.dom not tested." 23 24 # vim: tabstop=4 expandtab shiftwidth=4