The best way to deal with this is to use different namespaces for 2D and
3D, Castor should then generate separate two java packages...one for
your 2D and the other for your 3D.  Otherwise, I believe your are asking
Castor to do the impossible.

 

________________________________

From: niestadt [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 27, 2007 1:03 AM
To: [email protected]
Subject: [castor-user] Generator trips over different elements with same
name

 

Hi all,

I have a problem with the Castor generator. I have a schema file uses
the same name for different elements. For example, there are multiple
elements named "shape" that are used in different places, with different
possible values (for example: object2D/shape with possible values
"circle" and "triangle" and object3D/shape with possible values "sphere"
and "cube").

Of course, I'm using a binding.xml file to tell Castor what to call the
classes. The different classes are generated correctly, but are not
referred to correctly. Castor correctly generates the two shape classes,
"Object2D_shapeType" and "Object3D_shapeType", but incorrectly refers to
shape objects with the class name "ShapeType" (which is of course a
nonexistent class).

Is this a bug or am I doing something wrong? Here's my schema file
(test.xsd) <http://www.nabble.com/file/7453/test.xsd>  and my
binding.xml file <http://www.nabble.com/file/7454/binding.xml> .

I'm running Castor with the following parameters: -i test.xsd
-binding-file binding.xml

Thanks in advance for any light you can shed on this!
Best regards,
Jan.

 

________________________________

View this message in context: Generator trips over different elements
with same name
<http://www.nabble.com/Generator-trips-over-different-elements-with-same
-name-tf3472379.html#a9690213> 
Sent from the Castor - User mailing list archive
<http://www.nabble.com/Castor---User-f2411.html>  at Nabble.com.

Reply via email to