Hi Juan,

You might want to try changing your castorbuilder.properties file to use
the type-centric approach:

http://castor.exolab.org/sourcegen.html#The-'type'-method

--Keith


Juan Wu wrote:
> 
> Hi, Keith,
> 
> Thanks a lot for your answer.
> 
> In a java program, I'm using the SourceGenerator to process XML schema
> specified in any user specified xsd/wsdl files. Since the XML schema
> specified in xsd/wsdl file is valid for using same names for both element(s)
> and complexType(s), I can't update the program to alter one of the names
> with prefix and I also can't know the conflicted names before-hand (without
> parsing through the xml) to generate the Castor binding-file ... In my case,
> the XML schema has to be processed on the fly at run-time.
> 
> Is there a way that can let SourceGenerator turn on the option to generate
> java classes only based on the complexType and ignore the same name element
> when there is a name confliction?
> 
> BTW, I can see that "Exercise" is defined as an element of an Array
> "ArrayofExercise" and it was not defined as a standalone element in the
> schema. Is this another reason for the confliction problem of
> SourceGenerator?
> 
> Thanks,
> Juan
> 
> E BUSINESS ARCHITECTURE
> Phone: (925) 236-4816 (O)
> ----- Original Message -----
> From: "Keith Visco" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 17, 2003 1:49 PM
> Subject: Re: [castor-dev] java syntax errors in generated java files by
> using Castor SourceGenerator
> 
> >
> >
> > Hi Juan,
> >
> > Anytime you get "cyclic" inheritence problems, it means that you have
> > both element(s) and complexType(s) with the same name. Castor is trying
> > to make the class associated with the element, extend that of the
> > complexType. Castor should be "smart" enough to detect this and warn the
> > user, but it currently does no such warnings.
> >
> > What you need to do is to use a binding-file
> > [http://castor.exolab.org/sourcegen.html#Binding-File] and either
> > specify a different class name for the element or the complexType, or
> > provide a suffix for all complexTypes such that no name collisions
> > occur.
> >
> > --Keith
> >
> > > Juan Wu wrote:
> > >
> > > Hi,
> > >
> > > I'm trying to use Castor's SourceGenerator (from version 0.9.5
> > > released on June 3, 2003) to parse a xsd file "xoption.xsd" which is
> > > generated by using the <types> node in the wsdl file
> > > of http://www.xignite.com/xoptions.asmx?WSDL
> > >
> > > The command option of "SourceGenerator" that I used to generate java
> > > bean files from xsd is: "-i xoptions.xsd -dest /work0/tmp -f -package
> > > generated.complextype.castor.com.xignite.www". Please refer to the
> > > attachment of this email for all generated java files and the
> > > xoptions.xsd file.
> > >
> > > But there are some problems with the generated java files:
> > >
> > > 1)
> > > The java files generated according to the complexTypes (such as:
> > > Grant, Exercise, Schedule and TaxProfile) specified in the xsd file
> > > have java compilation errors of "cyclic inheritance involving
> > > generated.complextype.castor.com.xignite.www.Exercise".
> > >
> > > There are codes like "public class Exercise extends Exercise" in the
> > > java files which caused the javac compilation to fail.
> > >
> > > 2)
> > > The generated java bean files don't actually contain the sequence
> > > elements of the corresponding complexType specified in xsd.
> > > For example: Exercise.java
> > > This java bean should have the properties of GrantNumber, Date,
> > > Shares, Price, Commission, and ExerciseType as specified in the xsd.
> > >
> > > Would you please take a look at this problem and let me know if this
> > > can be fixed? It would be great if there is an existing patch to make
> > > it work. Thank you very much!
> > >
> > > Regards,
> > > Juan
> > >
> > >
> > >                           Name: generated_files.jar
> > >    generated_files.jar    Type: Java Archive
> > >                                 (application/java-archive)
> > >                       Encoding: base64
> >
> > -----------------------------------------------------------
> > 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

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

Reply via email to