2013-06-01 | Paul Boddie | file changeset files shortlog | Fixed the document encoding for HTML documents retrieved using parseURI. Updated copyright and release information. |
paulb@40 | 1 | #!/usr/bin/env python |
paulb@40 | 2 | |
paulb@40 | 3 | import libxml2dom |
paulb@40 | 4 | import sys |
paulb@40 | 5 | |
paulb@40 | 6 | d = libxml2dom.parse(sys.argv[1]) |
paul@354 | 7 | |
paul@354 | 8 | print "Prettyprint using libxml2dom..." |
paul@354 | 9 | print |
paul@354 | 10 | |
paul@354 | 11 | d.toStream(sys.stdout, prettyprint=1) |
paul@354 | 12 | |
paul@354 | 13 | try: |
paul@354 | 14 | from xml.dom.ext import PrettyPrint |
paul@354 | 15 | |
paul@354 | 16 | print "Prettyprint using xml.dom..." |
paul@354 | 17 | print |
paul@354 | 18 | |
paul@354 | 19 | PrettyPrint(d) |
paul@354 | 20 | |
paul@354 | 21 | except ImportError: |
paul@354 | 22 | print "xml.dom not tested." |
paulb@40 | 23 | |
paulb@40 | 24 | # vim: tabstop=4 expandtab shiftwidth=4 |