[XML-SIG] Python equivalent to Perl's XML::Writer

Fredrik Lundh fredrik@pythonware.com
Mon, 25 Nov 2002 21:58:13 +0100


will ganz wrote:

> I am trying to generate XML output from data that is in a dictionary of a
> list of lists. My prior experience with this type of XML generation was with
> the XML::Writer module in that other 'P' scripting language. 
> 
> Is there a functional equivalent in Python? I've gone through "Python & XML"
> plus "XML Processing with Pelr, Python, and PHP" without much luck. I've got
> 4Thought's XML suite installed on Python 2.2.1 build 222 (ASPN). 

I'm not sure what XML::Writer does, but there's an XMLWriter class in the
ElementTree package that you might find useful (make sure you get 1.1b3
or later; the one in 1.1b2 is slightly broken):

    http://effbot.org/zone/xml-writer.htm (xmlwriter overview)

    http://effbot.org/downloads/ (code)

    http://effbot.org/zone/element-index.htm (elementtree overview)

</F>