Created
April 21, 2016 14:07
-
-
Save brianmc/bc16322ef884e3213cba71a18ab674f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import po1 | |
import pyxb | |
import inspect | |
import sys | |
import pyxb.binding.basis | |
xml = open('po2.xml').read() | |
pyxb.GlobalValidationConfig._setForBinding(False) | |
order = po1.CreateFromDocument(xml) | |
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, item.productName, item.USPrice)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment