New submission from Patrick W. <p...@borntolaugh.de>: When using xml.etree.ElementTree to parse external XML files, all XML comments within that file are being stripped out. I guess that happens because there is no comment handler in the expat parser.
Example: test.xml -------- <example> <nodeA /> <!-- some comment --> <nodeB /> </example> test.py ------- from xml.etree import ElementTree with open( 'test.xml', 'r' ) as f: xml = ElementTree.parse( f ) ElementTree.dump( xml ) Result ------ <example> <nodeA /> <nodeB /> </example> ---------- components: XML messages: 102051 nosy: poke severity: normal status: open title: ElementTree won't parse comments type: behavior versions: Python 3.1 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8277> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com