ElementTree.write() and doctype

Hi, I was looking for a way to specify a doctype with the write() method of an elementtree, analogous to the "doctype" argument for etree.tostring(). There seems to be no documented way to do so, but I found an (undocumented) argument called "docstring" (instead of "doctype") that seems to work just fine. Should this be renamed to "doctype" and added to the documentation, or is there a reason why it was left out and shouldn't be used? greetings, Steven

Not sure what you are referring to here.
Probably this:
As OP states it looks like there's an undocumented _ElementTree.write() arg "docstring": https://github.com/lxml/lxml/blob/master/src/lxml/lxml.etree.pyx#L1955-L1958 Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart

Holger Joukl schrieb am 16.01.2017 um 08:32:
Hmm, that's clearly a typo, i.e. a misspelled name. It was added back in 2010 and should have been named "doctype" like everywhere else. I'll deprecate the old name and add+document the "doctype" option. Thanks for bringing this up. Stefan

Not sure what you are referring to here.
Probably this:
As OP states it looks like there's an undocumented _ElementTree.write() arg "docstring": https://github.com/lxml/lxml/blob/master/src/lxml/lxml.etree.pyx#L1955-L1958 Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart

Holger Joukl schrieb am 16.01.2017 um 08:32:
Hmm, that's clearly a typo, i.e. a misspelled name. It was added back in 2010 and should have been named "doctype" like everywhere else. I'll deprecate the old name and add+document the "doctype" option. Thanks for bringing this up. Stefan
participants (3)
-
Holger Joukl
-
Stefan Behnel
-
Steven Vereecken