Nikolaus Rath added the comment:

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

----------
keywords: +patch
nosy: +Nikratio
versions: +Python 3.3, Python 3.4 -Python 3.1
Added file: http://bugs.python.org/file33538/testcase.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9521>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to