Hi Jasbir, Sorry I read you e-mail too fast: in that case you will need to declare a binding for the Authentication element to define a class name for it:
<cbf:binding xmlns:cbf="http://www.castor.org/SourceGenerator/Binding" defaultBindingType='element'> <cbf:elementBinding name="/Login/Authentication"> <cbf:java-class name="MyAuthentication"/> </cbf:elementBinding> </cbf:binding> This should help you (this time ;+)) Arnaud > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 09, 2002 7:04 PM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] Duplicate element names in schema? > > > Arnaud, > > I can't see how prefixing the complexType class names will solve the > problem. The heart of the problem is the duplicate use of the element > <Authentication>? > > Jasbir > > > > > "Arnaud > Blandin" To: [EMAIL PROTECTED] > <blandin@intal cc: > io.com> Subject: Re: [castor-dev] > Duplicate element names in schema? > > 09/12/2002 > 17:37 > Please respond > to castor-dev > > > > > > > Hi Jasbir, > > Using the CVS version you could use a binding file if you don't want to > alterate your XML Schema. > The following is a very basic binding file that prefixes all complexType > class names with Type: > <?xml version="1.0"?> > > <cbf:binding xmlns:cbf="http://www.castor.org/SourceGenerator/Binding" > defaultBindingType='element'> > > <cbf:namingXML> > <cbf:complexTypeName> > <cbf:suffix>Type</cbf:suffix> > </cbf:complexTypeName> > </cbf:namingXML> > </cbf:binding> > > Hope that helps, > > Arnaud > > > -----Original Message----- > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 09, 2002 6:18 PM > > To: [EMAIL PROTECTED] > > Subject: [castor-dev] Duplicate element names in schema? > > > > How can I get round this problem, my schema contains two transactions, > > Login and Submit. The Login takes > > a userId and password for its <authentication> while the Submit takes > the > > password only. Castor seem to generator > > one _Authentication class which always assumes a userId only! I guess > it > > can't distingush between the two > > <authentication> elements defined? Schema is below and I need to keep > the > > <authentication> element for both transactions. > > > > TIA > > > > Jasbir > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > elementFormDefault=" > > qualified" attributeFormDefault="unqualified"> > > > > <xs:simpleType name="_userId"> > > <xs:restriction base="xs:string"> > > <xs:minLength value="1"/> > > <xs:maxLength value="10"/> > > <xs:pattern value="[A-Z0-9]+"/> > > </xs:restriction> > > </xs:simpleType> > > > > <xs:simpleType name="_password"> > > <xs:restriction base="xs:string"> > > <xs:minLength value="1"/> > > <xs:maxLength value="10"/> > > <xs:pattern value="[A-Z0-9]+"/> > > </xs:restriction> > > </xs:simpleType> > > > > <xs:complexType name="_Authentication"> > > <xs:sequence> > > <xs:element name="userId" type="_userId"/> > > </xs:sequence> > > </xs:complexType> > > > > <xs:complexType name="_Login"> > > <xs:sequence> > > <xs:element name="Authentication"> > > <xs:complexType> > > <xs:sequence> > > <xs:element name="userId" type="_userId"/> > > <xs:element name="password" type="_password"/> > > </xs:sequence> > > </xs:complexType> > > </xs:element> > > </xs:sequence> > > </xs:complexType> > > > > <xs:complexType name="_Submit"> > > <xs:sequence> > > <xs:element name="Authentication" type="_Authentication"/> > > </xs:sequence> > > </xs:complexType> > > > > <xs:element name="Transaction"> > > <xs:complexType> > > <xs:choice> > > <xs:element name="Login" type="_Login"/> > > <xs:element name="Submit " type="_Submit"/> > > </xs:choice> > > </xs:complexType> > > </xs:element> > > > > </xs:schema> > > > > > > > > > > ----------------------------------------------------------- > 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
