Hi Martin, As you have discovered, maxOccurs and minOccurs are not handled correctly in the case when the value 0 is used. A bug report has been filled to track this bug:
http://bugzilla.exolab.org/show_bug.cgi?id=900 Sorry for the inconvenience, Arnaud > -----Original Message----- > From: Samberger Martin [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 18, 2002 9:24 PM > To: [EMAIL PROTECTED] > Subject: [castor-dev] maxOccur = 0 > > Hi, > > it seems that setting maxOccur to 0 has no impact on the generated source > code. > The field validator isn't set by invoking setMaxOccur(0) in the > ClassDescriptor, and the value for maxOccur in the source code of > FieldValidator defaults to -1 (meaning any number is allowed). > > Thus it's still possible to generate xml documents with elements which may > not be appear according to the schema. > A workaround would be - as I earlier mentioned - to delete this element > from > the schema as you will never use it. > But problems arise when you have to restrict an already defined > complexType > by subclassing und overriding the settings (e.g. maxOccur) of an element > differently defined in the superclass. > > Thx > Martin > > ----------------------------------------------------------- > 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
