Werner,
 
ok thanks, fair enough.
 
Any idea how to get warnings turned on? I've set it up in maven.xml but it is 
being ignored.
 
<goal name="generate">
<attainGoal name="castor:prepare-filesystem"/>
<castor:generate schema="${basedir}/src/conf/schema/buscomresults.xsd"
package="com.ft.search2005.result.buscom"
types="j2"
warnings="true"
verbose="true"/>
</goal>

Neale

________________________________

From: Werner Guttmann [mailto:[EMAIL PROTECTED]
Sent: Tue 25/04/2006 13:06
To: [email protected]
Subject: RE: [castor-user] problem with code generation with element and 
attributes of same name



Neale,

Can you please (re)enable warnings, and you'll see that you are running
into naming conflicts. In order to resolve these, please consider using
a bindings file ....

Werner

> -----Original Message-----
> From: Napier, Neale [mailto:[EMAIL PROTECTED]
> Sent: Dienstag, 25. April 2006 11:45
> To: [email protected]
> Subject: [castor-user] problem with code generation with
> element and attributes of same name
>
> Hi
>
> I have a schema where there is an element "result" with an
> attribute called "number". This element also has a sub
> element with the same name as the attribute in its parent
> element. Castor seems to be getting confused about this and
> generating an error. I have tried using the lastest version
> of castor 1.0 to generate the source code. Any advice would
> be gratefully appreciated.
>
> xml snippet
>
> <result number="1">
> <number>1</number> ...
>
> parameters
>
> schema=buscomresults.xsd
> package=com.ft.search2005.result
> types=j2
> 
> I have attached the schema and a sample xml file.
> 
> I get the following error...
> 
> [echo] Generating sources for
> C:\eclipse31\workspace\search2005/src/conf/schema/buscomresults.xsd
> [java] -- Suppressing non fatal warnings.
> [java] java.lang.IllegalArgumentException: duplicate name
> found: _number [java] at
> org.exolab.javasource.JClass.addField(JClass.java:182)
> [java] at
> org.exolab.castor.builder.FieldInfo.createJavaField(FieldInfo.
> java:217)
> [java] at
> org.exolab.castor.builder.SourceFactory.handleField(SourceFact
> ory.java:2111)
> [java] at
> org.exolab.castor.builder.SourceFactory.processContentModel(So
> urceFactory.java:1557)
> [java] at
> org.exolab.castor.builder.SourceFactory.processContentModel(So
> urceFactory.java:1594)
> [java] at
> org.exolab.castor.builder.SourceFactory.processComplexType(Sou
> rceFactory.java:1506)
> [java] at
> org.exolab.castor.builder.SourceFactory.createSourceCode(Sourc
> eFactory.java:426)
> [java] at
> org.exolab.castor.builder.SourceFactory.createSourceCode(Sourc
> eFactory.java:389)
> [java] at
> org.exolab.castor.builder.SourceGenerator.createClasses(Source
> Generator.java:1058)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processContentModel(
> SourceGenerator.java:1202)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processContentModel(
> SourceGenerator.java:1205)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processComplexType(S
> ourceGenerator.java:1152)
> [java] at
> org.exolab.castor.builder.SourceGenerator.createClasses(Source
> Generator.java:1067)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processContentModel(
> SourceGenerator.java:1202)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processContentModel(
> SourceGenerator.java:1205)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processComplexType(S
> ourceGenerator.java:1152)
> [java] at
> org.exolab.castor.builder.SourceGenerator.createClasses(Source
> Generator.java:1067)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processContentModel(
> SourceGenerator.java:1202)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processContentModel(
> SourceGenerator.java:1205)
> [java] at
> org.exolab.castor.builder.SourceGenerator.processComplexType(S
> ourceGenerator.java:1152)
> [java] at
> org.exolab.castor.builder.SourceGenerator.createClasses(Source
> Generator.java:1067)
> [java] at
> org.exolab.castor.builder.SourceGenerator.createClasses(Source
> Generator.java:944)
> [java] at
> org.exolab.castor.builder.SourceGenerator.generateSource(Sourc
> eGenerator.java:360)
> [java] at
> org.exolab.castor.builder.SourceGenerator.generateSource(Sourc
> eGenerator.java:442)
> [java] at
> org.exolab.castor.builder.SourceGenerator.generateSource(Sourc
> eGenerator.java:475)
> [java] at
> org.exolab.castor.builder.SourceGenerator.main(SourceGenerator
> .java:878)
>
> Cheers,
> Neale
>
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by MessageLabs. The
> information contained in this message is confidential and is
> intended for the addressee only. If you have received this
> message in error, please notify Conchango plc as soon as
> possible. The unauthorised use, disclosure, copying or
> alteration of this message is prohibited and may be unlawful.
> The internet cannot guarantee the integrity of this message
> and therefore Conchango plc will not be liable for the
> message if modified. 
>
> Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T
> 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E
> [EMAIL PROTECTED]  No. 2598884
>

-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




_____________________________________________________________________
This e-mail has been scanned for viruses by MessageLabs. The information 
contained in this message is confidential and is intended for the addressee 
only. If you have received this message in error, please notify Conchango plc 
as soon as possible. The unauthorised use, disclosure, copying or alteration of 
this message is prohibited and may be unlawful. The internet cannot guarantee 
the integrity of this message and therefore Conchango plc will not be liable 
for the message if modified.  

Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 
F 44 (0) 1784 222 200 E [EMAIL PROTECTED]  No. 2598884
-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to