[newbie] using ElementTree, how to add doctype and xml pi

dave berk dave.brk at gmail.com
Thu Mar 20 00:53:49 CET 2008

Hi all

I have an svg file i'm creating on the fly. How do I add the doctype and xml
pi? They're not an element per se, and there is no function to add them. Am
I suppose to add them as elements after all?

I have something like this:

self.svgRoot = ET.Element("svg", xmlns=r'http://www.w3.org/2000/svg')
ET.SubElement(self.svgRoot, "g", transform="scale(1,-1)")
self.tree = ET.ElementTree(self.svgRoot)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080320/53c5fb3d/attachment.html>

More information about the Python-list mailing list