TIBCOSoftware / genxdm

GenXDM: XQuery/XPath Data Model API, bridges, and processors for tree-model neutral access to XML.
http://www.genxdm.org/
9 stars 4 forks source link

Schema parser mistakenly reports cyclic types error #157

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 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 9 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