Skip to content

Instantly share code, notes, and snippets.

@brianmc
Created April 21, 2016 14:07
Show Gist options
  • Save brianmc/bc16322ef884e3213cba71a18ab674f5 to your computer and use it in GitHub Desktop.
Save brianmc/bc16322ef884e3213cba71a18ab674f5 to your computer and use it in GitHub Desktop.
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