I'm using org.exolab.castor.builder.javaclassmapping=type setting. Should this have any influence on how the unmarshalling works for xsi:type constructs?
The *Descriptor classes are all compiled (I'm sure because I'm using them at several places in my code, too).
Can you (or anybody else) tell me if the way I expect this to work is ok or if there is a general flaw in the way I expect the xsd:anyType/xsi:type stuff to work?
Lars.
Keith Visco wrote:
Hi Lars,
Are you using "type" or "element" centric bindings?
Also have you compiled all the *Descriptor.java classes?
--Keith
Lars Klose wrote:
Sorry to send the same question again, but I really need to find a solution for my problem. Maybe this time somebody has time to have a look at this. _Any_ small advice or pointer to relevant information would be appreciated...
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.
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-- _____________________________________________________ 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
