Hi Max, Which version are you using? Castor is creating the *good* classes but unfortunately it fails during the unmarshalling to plug to the good ClassDEscriptor..this is the nastiest bug we have for the moment.
Arnaud > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 19, 2001 7:22 AM > To: [EMAIL PROTECTED] > Subject: [castor-dev] unmarshalling problem > > > Hi, > > We have been using Castor's XML databinding for a while for our B2B service > project and were quite happy about it. Recently, though, we have bumped > into the following problem: > > when unmarshalling from XML: > > <Envelope> > <ELEMENTC>9999</ELEMENTC> > <ELEMENTD>A02</ELEMENTD> > </Envelope> > > into classes generated by the following schema: > > <xsd:element name = "Envelope"> > <xsd:complexType mixed = "false"> > <xsd:choice minOccurs = "1" maxOccurs = "3"> > <xsd:element ref = "ELEMENTA" minOccurs = "0" > maxOccurs = "1"/> > <xsd:element ref = "ELEMENTB" minOccurs = "0" > maxOccurs = "1"/> > <xsd:sequence minOccurs = "0" maxOccurs = "1"> > <xsd:element ref = "ELEMENTC"/> > <xsd:element ref = "ELEMENTD" minOccurs > = "0" maxOccurs = "1"/> > </xsd:sequence> > </xsd:choice> > </xsd:complexType> > </xsd:element>, > > Castor creates two sequences instead of one and then gets confused during > the validation step (validation exception: ELEMENTD is a required field). A > slightly different schema, where both children of the sequence are > optional: > > <xsd:element name = "Envelope"> > <xsd:complexType mixed = "false"> > <xsd:choice minOccurs = "1" maxOccurs = "3"> > <xsd:element ref = "ELEMENTA" minOccurs = "0" > maxOccurs = "1"/> > <xsd:element ref = "ELEMENTB" minOccurs = "0" > maxOccurs = "1"/> > <xsd:sequence minOccurs = "0" maxOccurs = "1"> > <xsd:element ref = "ELEMENTC" minOccurs = "0" maxOccurs > = "1"/> > <xsd:element ref = "ELEMENTD" minOccurs > = "0" maxOccurs = "1"/> > </xsd:sequence> > </xsd:choice> > </xsd:complexType> > </xsd:element> > > works perfectly well. > > Is it a known problem and is there a fix for it? > > Thank you, > > Max. > > ----------------------------------------------------------- > 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
