How to use GeneratedS to make DDEX XML bindings using generateds

I am interested in Python XML binding because it reads input files that conform to this pattern:
http://ddex.net/xml/ern/341/release- notification.xsd

This XSD depends on some others, but the most important is:
http://ddex.net/xml/20120404/ddexC.xsd and
http: //ddex.net/xml/20120404/ddex.xsd

My first attempt was to use generateDS. If I use –no-process-includes, I can successfully generate release-notification.xsd Binding:

./generateDS.py --no-process-includes -o release-notification.py release-notification.xsd

However, This leaves me with a mostly useless Python object, because most ComplexTypes are defined in ddexC.xsd.

If I try it without –no-process-includes , I get:

RuntimeError: Extension/restriction recursion detected.
Suggest you check definitions of types ArtistRole and ArtistRole.

mentioned The definition is like this:


....< br />


....

So it seems that the ddex and ddexC namespaces are somehow confused And create circular references.

Any suggestions?

You may need to view https://github.com/ddexnet with ddex lint script, you The script can be used to generate complete python objects, which are verified according to the complete ERN architecture located at http://ddex.net/xml/2010/ern-main/32.

(linter The ddexC namespace under the hood is also used).

I am interested in Python XML binding because it reads input files that conform to this pattern:
http://ddex.net/xml/ern/341/release-notification.xsd

This XSD depends on some others, but the most important thing is:
http://ddex .net/xml/20120404/ddexC.xsd and
http://ddex.net/xml/20120404/ddex.xsd

My first attempt is to use generateDS. If I use – no-process-includes, I can successfully generate the release-notification.xsd binding:

./generateDS.py --no-process-includes -o release-notification .py release-notification.xsd

However, this leaves me with a mostly useless Python object, because most ComplexTypes are defined in ddexC.xsd.

If I try it without –no-process-includes, I get:

RuntimeError: Extension/restriction recursion detected.
Suggest you check definitions of types ArtistRole and ArtistRole.

The definition mentioned is like this:


....



....

So it seems that the ddex and ddexC namespaces are somehow confused and create circular references.

Yes Any suggestions?

You may need to look at https://github.com/ddexnet with ddex lint script, you can use the script to generate complete python objects, these objects Validation is based on the complete ERN architecture located at http://ddex.net/xml/2010/ern-main/32.

(linter also uses the ddexC namespace under the hood).

Leave a Comment

Your email address will not be published.