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 nikratio
Recipients effbot, mark, nikratio
Date 2014-01-19.04:52:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390107142.04.0.93645433408.issue9521@psf.upfronthosting.co.za>
In-reply-to
Content
I can confirm this. The actual problem is that neither XML nor SGML PIs  in the input make it into the etree, and no events are generated for them during incremental parsing.

XML PIs that are added into the tree using Python functions are correctly written out. SGML PIs currently cannot be represented at all (there's no ElementTree.SGMLProcessingInstruction analogous to ElementTree.ProcessingInstruction)

There is special cased support for the DOCTYPE element in the TreeBuilder class to allow retrieving the doctype when not parsing incrementally, but it needs to be retrieved manually and written out manually.


I have attached a testcase for XML PIs.  For proper SGML PI handling, ElementTree first needs to learn about them.

Recommended stage for this issue: needs patch
History
Date User Action Args
2014-01-19 04:52:22nikratiosetrecipients: + nikratio, effbot, mark
2014-01-19 04:52:22nikratiosetmessageid: <1390107142.04.0.93645433408.issue9521@psf.upfronthosting.co.za>
2014-01-19 04:52:21nikratiolinkissue9521 messages
2014-01-19 04:52:21nikratiocreate