[issue24287] Let ElementTree prolog include comments and processing instructions

2019-04-27 Thread Stefan Behnel
Stefan Behnel added the comment: This is a duplicate of 9521, but it's difficult to say which ticket is better. -- ___ Python tracker ___ _

[issue24287] Let ElementTree prolog include comments and processing instructions

2019-04-27 Thread Stefan Behnel
Change by Stefan Behnel : -- superseder: -> xml.etree.ElementTree skips processing instructions when parsing ___ Python tracker ___ ___

[issue24287] Let ElementTree prolog include comments and processing instructions

2015-05-25 Thread Stefan Behnel
Stefan Behnel added the comment: FTR, lxml's Element class has addnext() and addprevious() methods which are commonly used for this purpose. But ET can't adopt those due to its different tree model. I second Martin's comment that ET.append() is a misleading name. It suggests adding stuff to t

[issue24287] Let ElementTree prolog include comments and processing instructions

2015-05-25 Thread Martin Panter
Martin Panter added the comment: The ElementTree class imitates or wraps many methods of the Element class. Since Element.append() and remove() already exist and act on children of the element, I think the new ElementTree methods should be named differently. Maybe something like prolog_append(

[issue24287] Let ElementTree prolog include comments and processing instructions

2015-05-25 Thread Raymond Hettinger
New submission from Raymond Hettinger: Currently, ElementTree doesn't support comments and processing instructions in the prolog. That is the typical place to put style-sheets and document type definitions. It would be used like this: from xml.etree.ElementTree import ElementTree, Elemen