That is how I dealt with it.  You are running up against a fundamental
brick wall when you do what you are trying to do, which is to treat XML
and OO Design as essentially equivalent...which they are obviously not.


Just like there is a "O-R Impedance", there is a I "O-X" Impedance and
perhaps a third "R-X Impedance".  Castor is just trying to do its best
to map between the three worlds of Object, Relational and XML.  No
matter how much you try, these worlds will *never* be exactly mapped.
Hence, the simplistic word "impossible".  

Just think about it.  If we do it you way, then we probably will have
disambiguate every single child class of every since castor class all
the way down to java.lang.object!  This would obviously be a fools
errand.  That is why we need to use some tricks like using different
packages if you must or, even more simple, just using different names if
you can.  


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


Why would it be impossible? The schema says that "shape" can appear
under
"object2D" or "object3D", and it specifies exactly what the valid
options
are in either case. There's no ambiguity; Castor could refer to either
object2D_shapeType or object3D_shapeType in every case, but instead it
refers to a non-existent class "ShapeType". I mean, the generated code
produces compile errors (In this case, "unresolved class ShapeType"),
how is
that not a bug?

But thanks for your answer, maybe it would work with different
namespaces..
Unfortunately I don't really have much control over the schema I'm
using, so
I can't really introduce lots of new namespaces without breaking other
stuff.


Uday Kari wrote:
> 
> 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.
> 
-- 
View this message in context:
http://www.nabble.com/Generator-trips-over-different-elements-with-same-
name-tf3472379.html#a9700680
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to