Having problems when the same name is used in two different namespaces:

File root.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/";
           xmlns:xs="http://www.w3.org/2001/XMLSchema";
           targetNamespace="http://schemas.xmlsoap.org/soap/envelope/";
           elementFormDefault="qualified"
           attributeFormDefault="qualified"
           version="v001">
  <xs:import namespace="http://xsd.example/v001/test1"; 
schemaLocation="test1.xsd"/>
  <xs:import namespace="http://xsd.example/v001/test2"; 
schemaLocation="test2.xsd"/>
</xs:schema>

test1.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:tns="http://xsd.example/v001/test1";
           xmlns:xs="http://www.w3.org/2001/XMLSchema";
           targetNamespace="http://xsd.example/v001/test1";
           elementFormDefault="qualified"
           attributeFormDefault="qualified"
           version="v001">
  <xs:complexType name="LifecycleDataType">
    <xs:sequence>
      <xs:element name="LifecycleID" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

test2.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:tns="http://xsd.example/v001/test2";
           xmlns:xs="http://www.w3.org/2001/XMLSchema";
           xmlns:test1="http://xsd.example/v001/test1";
           targetNamespace="http://xsd.example/v001/test2";
           elementFormDefault="qualified"
           attributeFormDefault="qualified"
           version="v001">
  <xs:complexType name="LifecycleDataType">
    <xs:complexContent>
      <xs:extension base="test1:LifecycleDataType">
        <xs:sequence minOccurs="0">
          <xs:element name="LifecycleName" type="xs:string"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

$ generateDS -o test.py root.xsd
...
  File "/home/phd/.virtualenvs/ufod2py/bin/generateDS.py", line 1378, in 
collectElementNames
    parent.collectElementNames(elementNames, count)
  File "/home/phd/.virtualenvs/ufod2py/bin/generateDS.py", line 1378, in 
collectElementNames
    parent.collectElementNames(elementNames, count)
  File "/home/phd/.virtualenvs/ufod2py/bin/generateDS.py", line 1378, in 
collectElementNames
    parent.collectElementNames(elementNames, count)
  File "/home/phd/.virtualenvs/ufod2py/bin/generateDS.py", line 1377, in 
collectElementNames
    raise RuntimeError(msg)
RuntimeError: Extension/restriction recursion detected.  Suggest you check 
definitions of types LifecycleDataType and LifecycleDataType.

These are two different LifecycleDataType, no? One is
test1:LifecycleDataType, the other is test2:LifecycleDataType.

Oleg.
-- 
    Oleg Broytman            https://phdru.name/            p...@phdru.name
           Programmers don't die, they just GOSUB without RETURN.


_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to