Why doesn't xmlrpclib.dumps just dump an empty value instead of <nil/>?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Mar 17 08:29:56 CET 2008

On Sun, 16 Mar 2008 14:21:40 +0100, martin f krafft wrote:

> Hi,
> xmlrpclib.dumps((None,), allow_none=True) yields
>   '<params>\n<param>\n<value><nil/></value></param>\n</params>\n'
> Why doesn't it just yield
>   '<params>\n<param>\n<value/></param>\n</params>\n'
> Or even just
>   '<params>\n<param/>\n</params>\n'
> Those are valid XML and valid XML-RPC, but <nil/> isn't.

In XML-RPC there is no `None`, so there's the non standard `allow_none`
Option to allow `None` to be represented as ``<nil/>``.

And is an empty <param/> or <value/> really valid XML-RPC?

	Marc 'BlackJack' Rintsch

More information about the Python-list mailing list