Hi,

I have a schema like the following which uses anyType elements ("content") because at that place different elements (of types defined in an include) may occur:

    <xsd:element name="messagelist">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="message"
                             minOccurs="0" maxOccurs="unbounded">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element name="sender" type="xsd:string"/>
                            <xsd:element name="content" type="xsd:anyType"/>
                            <xsd:element name="sequence-number"
                                         type="xsd:integer"/>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

One possible "content" element is (using a complex type "tSpecialContentOne"):

<xsd:element name="specialContentOne" type="tSpecialContentOne"/>

When I generate Code for the schema and marshal objects I get something like this (namespace prefixes omitted):

<messagelist>
    <message>
        <sender>mySender</sender>
        <content xsi:type="specialContentOne">
            ...
        </content>
        <sequence-number>17</sequence-number>
    </message>
    ...
</messagelist>

This is ok for me, *but*: I'm not able to unmarshal this back with objects of class TSpecialContentOne - I only get AnyNode objects instead for each "content" element!?

Maybe I'm missing something here?
Any help appreciated...

Lars.
--
_____________________________________________________
Lars Klose                 Tel.    +49 711 / 9672-138
Klein + Stekl GmbH         Fax     +49 711 / 9672-130
Heusteigstrasse 41         mailto:[EMAIL PROTECTED]
70180 Stuttgart            http://www.klst.com
Amtsgericht Kirchheim/Teck HRB 180

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to