[Fedora-suds-list] Creating an element with both attribute and value

Erik Cederstrand erik at cederstrand.dk
Thu Jul 15 10:13:46 UTC 2010


Hi

I have an element defined in my XSD which I create like this:

	myobject.Body = create('t:BodyType')

It expects both an attribute and some content:

	<ns0:Body BodyType="Text">
		Hello from Suds!
	</ns0:Body>

I can specify the attribute like this:

	myobject.Body._BodyType = "Text"

But how do I add my content? If I just do this:

	myobject.Body = "Hello from Suds!"
	myobject.Body._BodyType = "Text"

, Python complains about myobject.Body being a string. According to http://osdir.com/ml/fedora-suds-list/2010-05/msg00012.html, I should use:

	myobject.Body.value = "Hello from Suds!"
	myobject.Body._BodyType = "Text"

, but it just complains that:

	suds.TypeNotFound: Type not found: 'value'

Did I just hit bug #323 (https://fedorahosted.org/suds/ticket/323)?

Thanks,
Erik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1928 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20100715/4943002f/attachment.bin 


More information about the suds mailing list