Namespace Recursion
Brought to you by:
dkuhlman
Hi,
I'm triying to generate a class for a UBL xsd (https://docs.oasis-open.org/ubl/prd1-UBL-2.1/xsd/common/UBL-CommonBasicComponents-2.1.xsd) and I get the following error:
RuntimeError: Extension/restriction recursion detected. Suggest you check definitions of types TextType and TextType.
The recursion is generated at this line:
<xsd:complexType name="TextType">
<xsd:simpleContent>
<xsd:extension base="udt:TextType"/>
</xsd:simpleContent>
</xsd:complexType>
The names are the same but the namespace is different.
David,
Thanks for the report and the link to the schemas.
I've looked into this a bit.
I don't think I'm going to be able to fix it.
It looks like fixes would be needed at multiple places in the code.
There are several other places in the code where similar
recursion-limit-exceeded occurs. And, I don't even know the correct
way to fix any of those places. I can patch those to skip the
recursion error, but then the module that we generate is incomplete.
If you have a suggestion or a patch, please let me know.
I'll do a little more study, but I don't have that hope.
Dave
I hit into this issue recently while trying to convert an xsd specification to python classes using this tool.
I am using the following repository to convert IP-XACT xsd specification:
https://github.com/olofk/ipxact_gen
I used the following command to generate a single file output:
Which results in successful conversion with some warnings:
But when trying to enable the --one-file-per-xsd option to have a bunch of python modules to be used to support reading IP-XACT xml files.
It fails with the error message mentioned below:
Seems like it falls over while trying to split into multiple files, but single file generation works without any issues.
Let me know in case you need more inputs.
Ameya