[xsde-users] Polymorphic crash.

Jones Chris Chris.Jones at helvar.com
Tue Dec 8 06:37:33 EST 2015


Hi Boris,

I'm currently working on a system where we are using your XSDe system to help us generate polymorphic structures, however I seem to have found a problem causing the XSDe Utility to crash.

Using 3.2.0 on a windows 7 system.

Take the two xsd files

<?xml version="1.0" encoding="utf-8"?>

<xs:schema  targetNamespace="http://www.helvar.com/Test1"
            xmlns="http://www.helvar.com/Test1"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
                elementFormDefault="qualified">

    <xs:complexType name="EntityTest2">
         <xs:sequence>
         </xs:sequence>
    </xs:complexType>
    <xs:element name="EntityTest2" type="EntityTest2"/>

    <xs:complexType name="ProductBaseTest2">
        <xs:complexContent>
            <xs:extension base="EntityTest2">
                <xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:element name="ProductBaseTest2" type="ProductBaseTest2" substitutionGroup="EntityTest2" />

    <xs:complexType name="ControlledLoadTest2">
        <xs:complexContent>
            <xs:extension base="ProductBaseTest2">
                <xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <xs:element name="ControlledLoadTest2" type="ControlledLoadTest2" substitutionGroup="ProductBaseTest2"/>

</xs:schema>
And

<?xml version="1.0" encoding="utf-8"?>

<xs:schema  targetNamespace="http://www.helvar.com/Test2"
            xmlns="http://www.helvar.com/Test2"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:Test1="http://www.helvar.com/Test1"
                elementFormDefault="qualified">

            <xs:import schemaLocation="Test1.xsd" namespace="http://www.helvar.com/Test1"/>

    <xs:complexType name="SDIMLoad">
        <xs:complexContent>
            <xs:extension base="Test1:ControlledLoadTest2">
                <xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
                <xs:element name="SDIMLoad" type="SDIMLoad" substitutionGroup="Test1:ControlledLoadTest2"/>

</xs:schema >

And using the command :

xsde.exe cxx-hybrid --output-dir "out" --generate-parser --generate-aggregate --generate-polymorphic --root-element EntitiesTest2 --no-long-long --polymorphic-type ProductBaseTest2 --polymorphic-type ControlledLoadTest2 --polymorphic-type EntityTest2  --namespace-map http://www.w3.org/2001/XMLSchema=XMLEntities "Test1.xsd" "Test2.xsd"

And the result is "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

I have played around with this a little bit and there are some salient bits of information.

If you move the "SDIMLoad" out of its own schema and into the other one, everything is fine, in fact you can inherit to your hearts delight and the code generated is as expected.

If you inherit "SDIMLoad" from "ProductBaseTest2" as opposed to "ControlledLoadTest2" then things seem to work, and the generated code is as expected.



If there's any other information I can supply for you please just ask.

Chris Jones

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test1.xsd
Type: text/xml
Size: 1224 bytes
Desc: Test1.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20151208/5011ced2/Test1.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test2.xsd
Type: text/xml
Size: 802 bytes
Desc: Test2.xsd
Url : http://codesynthesis.com/pipermail/xsde-users/attachments/20151208/5011ced2/Test2.bin


More information about the xsde-users mailing list