editing XML via DOM

Stephen Thorne stephen.thorne at gmail.com
Tue Dec 21 07:00:57 CET 2004


On Mon, 20 Dec 2004 21:45:14 +0100, jaco <jaco.van.iterson at hetnet.nl> wrote:
> Hi,
> 
> I'm new to Python and XML but still I want to create something that
> includes creating and editing XML using Python.
> 
> Now I'm looking for a little example program that does (some of) this to
> set me on my way.
> 
> Is there something like this available or can somebody give me some
> example lines that creates and saves some XML data?

I use a really forgiving XML library called 'microdom' that resides in
the twisted library. I won't give an example of that - but I do
recommend it if you have a situation where you need to parse crappy
xml.

A quick google comes up with:

http://www.acooke.org/andrew/writing/python-xml.html
which shows how to use xml.dom.ext.reader.Sax.FromXmlFile and then
doing some stuff with createElement, appendChild and
getElementsByTagName.

Regards,
Stephen Thorne



More information about the Python-list mailing list