Creating referenceable objects from XML

Diez B. Roggisch deets at web.de
Mon Dec 5 06:32:11 EST 2005


Michael Williams wrote:
> I'm looking for a quality Python XML implementation.  All of the DOM
> and SAX implementations I've come across so far are rather
> convoluted.

Welcome to the wonderful world of XML.

> I need it to somehow convert my XML to intuitively referenceable
> object.  Any ideas?  I could even do it myself if I knew the
> mechanism by which python classes do this (create variables on the fly).

You've been given the advice to use ElementTree - I can only second
that.

But if for whatever reason you do want to do it yourself (or for future
use), the

getattr/setattr

functions are what you are looking for. Look them up in TFM.

Regards,

Diez




More information about the Python-list mailing list