Building an XML file from an XSD using Python

563 Views Asked by At

can I build an XML file from XSD using Python?
I found that xmlschema package expected to do this but failed to found a simple working example...

For example, using the code below its not working for me:

xs = xmlschema.XMLSchema('tests/test_cases/examples/collection/collection.xsd')
pprint(xs.to_dict('tests/test_cases/examples/collection/collection.xml'))

another option is using the generateDS package.

0

There are 0 best solutions below