Cannot change doctype
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Medium
|
Olli Pottonen |
Bug Description
It appears that when one creates a new HTML document (with lxml.html.Element() or lxml.html.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://
I found no way of changing the doctype, either at creation time or later.
Similarly XML document has no doctype and this also seems impossible to change.
Of course there is a workaround: if I want e.g. HTML 4.10 document, instead of
e = lxml.html.
I can call
e = lxml.html.
but especially if I build the document bottom up (not starting at the root element), this is clumsy.
(I suppose this is of low importance.)
proposed implementation: /github. com/opottone/ lxml/commit/ 3c3dc943aab6492 4935b0782d8691d a3e022afef
https:/