I am having trouble getting XmlBeans to return the Java class I want from an
XML document. The XSD defines a complex type containing a list of an
abstract type. In another namespace I am defining a concrete extension of
the abstract type. When I parse an xml document containing on of these
lists, it returns references to the abstract type's class, not the concrete
type. If I change the list to a list of anyType instead of the abstract
type, I get back the expected class. Here are my XSD's:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://domain/test";
            xmlns:test="http://domain/test";
            elementFormDefault="qualified">
    <xsd:complexType name="testType">
        <xsd:sequence>
            <xsd:element name="typeExtensions" minOccurs="0"
type="test:testTypeExtensions"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="testTypeExtensions">
        <xsd:sequence>
            <!--<xsd:element name="extension" type="test:testTypeExtension"
maxOccurs="unbounded" minOccurs="0"></xsd:element>-->
            <xsd:element name="extension" type="xsd:anyType"
maxOccurs="unbounded" minOccurs="0"></xsd:element>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="testTypeExtension" abstract="true">
        <xsd:sequence/>
    </xsd:complexType>
    <xsd:element name="test" type="test:testType"/>
</xsd:schema>

****XSD #2**************************************

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
            targetNamespace="http://domain/test/ext";
            xmlns:test="http://domain/test";
            elementFormDefault="qualified">
    <xsd:import namespace="http://domain/test";
schemaLocation="test.xsd"></xsd:import>
    <xsd:complexType name="testTypeClientExtension">
        <xsd:complexContent>
            <xsd:extension base="test:testTypeExtension">
                <xsd:sequence>
                    <xsd:element name="extensionElement"
type="xsd:string"></xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:schema>


-- 
View this message in context: 
http://www.nabble.com/xsi%3Atype-and-Java-Class-tf4807282.html#a13754000
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to