Python code from XMLSchema?
Dave Kuhlman
dkuhlman at rexx.com
Fri Jul 2 11:47:32 EDT 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
> used.
>
> 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.
http://www.rexx.com/~dkuhlman/generateDS.html
http://gnosis.cx/publish/programming/xml_matters_2.txt
And, here is a document that compares the above two approaches:
http://www.rexx.com/~dkuhlman/gnosis_generateds.html
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:
http://www.rexx.com/~dkuhlman/xsltvsgenerateds.html
Dave
[snip]
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
More information about the Python-list
mailing list