By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 2,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Thanks for any thoughts...

--
martin | http://madduck.net/ | http://two.sentenc.es/

a farmer is a man outstanding in his field.

spamtraps: ma***********@madduck.net

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH3R7kIgvIgzMMSnURAiKSAKC9gq4Ysnuy1Rm3Yx2SAr CM0iOcSgCgsTKk
E4v2x0l/23PS2Mz8DqakOg0=
=C0Qw
-----END PGP SIGNATURE-----

Mar 16 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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?

Ciao,
Marc 'BlackJack' Rintsch
Mar 17 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.