sshyran / genxdm

Automatically exported from code.google.com/p/genxdm
0 stars 0 forks source link

Schema parser mistakenly reports cyclic types error #157

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If TypeB extends TypeA and TypeA's content model has a reference to TypeB, 
we're reporting an cyclic type error.  That's incorrect.  Here's a schema to 
reproduce the issue:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
targetNamespace="http://test" xmlns="http://test" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xsd:complexType name="AType" abstract="true">
            <xsd:sequence>
                <xsd:element name="bElem" type="BType" minOccurs="0" maxOccurs="unbounded"/>
            </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="BType">
            <xsd:complexContent>
                <xsd:extension base="AType">
                    <xsd:sequence>
                        <xsd:element name="foo" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                    </xsd:sequence>
                </xsd:extension>
            </xsd:complexContent>
    </xsd:complexType>
</xsd:schema>

Original issue reported on code.google.com by joe.bays...@gmail.com on 5 Dec 2014 at 9:38

GoogleCodeExporter commented 8 years ago
Fixed at revision 521.  Now, when converting interim XMLType objects to model 
Type, we add the newly minted ComplexTypeImpl to the outBag before processing 
its baseType.

Original comment by joe.bays...@gmail.com on 5 Dec 2014 at 9:45