Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 1f34149679700274d273f929cf13b29a > files > 1113

PyXB-1.1.2-1.fc15.noarch.rpm

import pyxb
import po3
import address

az = address.USState('AZ')
addr = address.USAddress()
addr.name = 'Robert Smith'
addr.street = '8 Oak Avenue'
addr.city = 'Anytown'
addr.state = 'AK'
addr.zip = 12341

print addr.toxml()

try:
    ny = address.USState('NY')
    assert False
except pyxb.BadTypeValueError, e:
    print e



#print '%s is sending %s %d thing(s):' % (order.billTo.name, order.shipTo.name, len(order.items.item))
#for item in order.items.item:
#    print '  Quantity %d of %s at $%s' % (item.quantity.content, item.productName, item.USPrice)