Below is an example with several approaches that work for me. I've
also added some comments in context explaining why what you tried
didn't work.
import items
inv = items.items()
# can't have empty inventory; need minOccurs="0"
#print inv.toxml()
i1 = items.Item(name="cheese", price="50")
inv.i
I also tried to use the append method() :
inv = items.Items()
inv.item.append(i1)
inv.item.append(i2)
print(inv.toxml())
This time, the error comes from toxml() :
Traceback (most recent call last):
File "test2.py", line 9, in
print(inv.toxml())
File "C:\Documents and Settings\sgadioux\A
Hi,
I am trying to use PyXB (1.2.3) to produce XML from python object.
I have a simple xsd schema:
http://www.w3.org/2001/XMLSchema";>
I generated bindings with the command:
pyxbgen" -u items.xsd -m items
I am able to read an xml (with CreateFromDocument) and get a