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

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Mar 19 21:56:17 EDT 2008


En Wed, 19 Mar 2008 20:53:49 -0300, dave berk <dave.brk at gmail.com>  
escribió:

> 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.

The easiest way (but perhaps not-so-pure) is to just write those lines by  
hand before the document itself; see a recent post about "Inserting DTD  
statement to XML"

-- 
Gabriel Genellina




More information about the Python-list mailing list