Logo

Programming-Idioms

History of Idiom 103 > diff from v6 to v7

Edit summary for version 7 by bukzor:
New Python implementation by user [bukzor]

Version 6

2017-07-29, 11:04:00

Version 7

2018-04-08, 07:25:34

Idiom #103 Load XML file into struct

Read from file data.xml and write its content into object x.
Assume the XML data is suitable for the type of x.

Idiom #103 Load XML file into struct

Read from file data.xml and write its content into object x.
Assume the XML data is suitable for the type of x.

Imports
import lxml.etree
Code
x = lxml.etree.parse('data.xml')
Comments bubble
Use "pip install" to get this third-party library. It's industry standard for python xml.