I am implementing a client for the TRIAS APIs v 1.0 and v 1.1 using PyXB.
The problem I'm facing is, that both XSD collections have the same namespace with same elements with differing content.
So I built two class bindings with pyxbgen
for each version.
However I now cannot use them both within the same program, since PyXB will throw a pyxb.exceptions_.NamespaceUniquenessError
:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/trias/v1_1/trias.py", line 31, in <module>
import trias.v1_1.siri as _ImportedBinding_trias_v1_1_siri
File "/usr/local/lib/python3.7/dist-packages/trias/v1_1/siri.py", line 30, in <module>
import trias.v1_1._nsgroup as _ImportedBinding_trias_v1_1__nsgroup
File "/usr/local/lib/python3.7/dist-packages/trias/v1_1/_nsgroup.py", line 31, in <module>
import trias.v1_1._D2LogicalModel as _ImportedBinding_trias_v1_1__D2LogicalModel
File "/usr/local/lib/python3.7/dist-packages/trias/v1_1/_D2LogicalModel.py", line 93, in <module>
Namespace.addCategoryObject('typeBinding', 'AbnormalTrafficTypeEnum', AbnormalTrafficTypeEnum)
File "/usr/lib/python3/dist-packages/pyxb/namespace/__init__.py", line 346, in addCategoryObject
raise pyxb.NamespaceUniquenessError(self, '%s: name %s used for multiple values in %s' % (self, local_name, category))
pyxb.exceptions_.NamespaceUniquenessError: http://datex2.eu/schema/1_0/1_0: name AbnormalTrafficTypeEnum used for multiple values in typeBinding
How can I use both class bindings within the same program? I cannot edit the source XSD files, since they are not maintained by myself and cannot merge them, since they contain significant differences.