(with_doctype=False)
| 56 | |
| 57 | |
| 58 | def create_svg_object(with_doctype=False) -> xml.dom.minidom.Document: |
| 59 | imp = xml.dom.minidom.getDOMImplementation() |
| 60 | assert imp is not None |
| 61 | doctype = imp.createDocumentType( |
| 62 | "svg", |
| 63 | "-//W3C//DTD SVG 1.1//EN", |
| 64 | "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", |
| 65 | ) |
| 66 | document = imp.createDocument(None, "svg", doctype if with_doctype else None) |
| 67 | _set_attributes( |
| 68 | document.documentElement, version="1.1", xmlns="http://www.w3.org/2000/svg" |
| 69 | ) |
| 70 | return document |
| 71 | |
| 72 | |
| 73 | SIZE = "{0:.3f}mm" |
no test coverage detected