This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author poke
Recipients poke
Date 2010-04-01.01:37:43
SpamBayes Score 3.876941e-05
Marked as misclassified No
Message-id <1270085866.99.0.0885322891054.issue8277@psf.upfronthosting.co.za>
In-reply-to
Content
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>
History
Date User Action Args
2010-04-01 01:37:47pokesetrecipients: + poke
2010-04-01 01:37:46pokesetmessageid: <1270085866.99.0.0885322891054.issue8277@psf.upfronthosting.co.za>
2010-04-01 01:37:44pokelinkissue8277 messages
2010-04-01 01:37:43pokecreate