convert to XMLRPC

Stefan Behnel stefan_ml at behnel.de
Fri Nov 7 01:46:31 EST 2008


Michel Perez wrote:
> [db connection]
> In the stdlib xmlrpclib handles this in a common way, but i use a
> customized GatewayHandler that give me the posibility to serialize my
> objects and send them to my clients

Doesn't XML-RPC do that for you already? What's the protocol you use for
client communication?


> but my real need is to convert this
> object to XML -or something like it- to send it in a way i can use them
> in every presentation a suggest like GUI, WEB or anything i like.
> There's any thing i can do to convert them.

You can recursively copy the attributes of your objects into the E factory of
lxml, either with generic code, or with specialised code for each (sub-)object.

http://codespeak.net/lxml/tutorial.html#the-e-factory

There's also a separate implementation for plain ElementTree (the xml.etree
package) by Fredrik Lundh.

Stefan



More information about the Python-list mailing list