Problem: Handler class newInstance method in generated Descriptor class tries 
to instantiate abstract class.

Hi,

I found a problem description similar to mine with no answer:
http://www.mail-archive.com/[email protected]/msg01049.html

I want to formulate the question from my point of view with the hope that 
someone who has solved the problem might read this.

I have attached my XSD in a trimmed down version that could be used to 
reproduce the problem.  In my XSD I have a substitution group head 
(PageElement) with the abstract attribute set to true.

The source code generator correctly generates the PageElement class as 
abstract.  But the PageItemDescriptor page contains the handler that wants to 
instantiate the abstract PageElement class.  I am not sure if this is a problem 
within the source code generator or if this can be solved via configuration.

Thanks in advance for any hint or pointer to how to solve the problem.

The XSD below is just a sub-set of my original file and I would be happy if I 
could continue using the substitution group since the original XSD has about 
30+ derived elements

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified" attributeFormDefault="unqualified">
        <xs:element name="Page">
                <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                                <xs:element ref="PageElement" minOccurs="0" 
maxOccurs="unbounded"/>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
        <xs:complexType name="PageElementType" abstract="false"/>
        <xs:element name="PageElement" type="PageElementType" abstract="true"/>
        <xs:complexType name="QuestionElementType" abstract="false">
                <xs:complexContent>
                        <xs:extension base="PageElementType"/>
                </xs:complexContent>
        </xs:complexType>
        <xs:element name="QuestionElement" type="QuestionElementType" 
abstract="true" substitutionGroup="PageElement"/>
</xs:schema>


Andreas Guther
MarketTools, Inc.
www.markettools.com
MarketTools®
Real Market Research Insights.  In Real Time.  At Real Savings.



-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to