Skip to content

Instantly share code, notes, and snippets.

@guinslym
Forked from anupamshakya7/Transformation_From_XSLT
Last active August 29, 2015 14:15
Show Gist options
  • Save guinslym/abeeae08ad99df6ef55c to your computer and use it in GitHub Desktop.
Save guinslym/abeeae08ad99df6ef55c to your computer and use it in GitHub Desktop.
from lxml import etree
data = open('D:\Conversion\MACSXML_Parts.xslt')
xslt_content = data.read()
xslt_root = etree.XML(xslt_content)
dom = etree.parse('D:\Conversion\Cat2015UF.xml')
transform = etree.XSLT(xslt_root)
result = transform(dom)
f = open('D:\Conversion\MACSXML_Parts.csv', 'w')
f.write(str(result1))
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment