Python code from XMLSchema?
dkuhlman at rexx.com
Fri Jul 2 17:47:32 CEST 2004
Russell Lear wrote:
> I need to be able to unmarshall data from an XML file into
> (instances of)
> appropriate Python classes . I don't have control over the schema
> I'd like the Python classes to use lists for elements whose
> XMLSchema spec has maxOccurs > 1, simple attributes for maxOccurs
> = minOccurs = 1, dict for element attributes, etc.
Here are links to two different solutions: generateDS.py and
xml_objectify. One is shameless self-promotion; you will have to
figure out which.
And, here is a document that compares the above two approaches:
And, if you are considering the use of XSLT, you may also be
interested in the following document, which describes the use of
generateDS.py as an alternative to XSLT:
More information about the Python-list