Sylvain,
I need a full (albeit minimal) XML schema to assess this problem fully.
Can you please create a new Jira issue and attach all relevant files,
i.e. XML schema, JUnit test cased that mimics what you are describing
below, problem description, etc.
Somehow I am under the impression that this could be a bug, indeed. But
let's first supply me with somthing to 'play with'.
Not sure about your second question, though. I think that Castor will be
able to deal with this by default, as I assume that you'd be using an
import statement in your main XML schema, right ?
Werner
Sylvain Lemasson wrote:
> Hello, I am new in castor and I face a problem concerning xsi:type
> and inheritance. Assume that we define the following code in a schema
> <complexType name="vehicule" abstract="true"></complexType>
> <complexType name="car"> <complexContent> <extension
> base="vehicule">...</extension> </complexContent> </complexType>
>
> <complexType name="travel"> <sequence> <element name="vehicule"
> type="tns:vehicule"/> </sequence> </complexType>
>
> I generate the class using the generator. I have a conflict between
> complexType:travel/vehicule and the complex type
> complexType:vehicule. There is a conflict because the generator try
> to create a new class which extends the class Vehicule. If I solve it
> using the following rule:
>
> <complexTypeBinding name="/complexType:travel/vehicule"> <java-class
> name="TravelVehicule"/> </complexTypeBinding>
>
> I could not use inheritance after because in the class Travel the
> type of the element vehicule is TravelVehicule and not Vehicule. So
> if I want to specify that I have traveled within a car, I could not
> set the attribute vehicule to an object which implement Car:
>
> public class Travel{ ... TravelVehicule _vehicule; ... }
>
> I can not do: Car car = new Car();.. travel.setVehicule(car). because
> car is not a TravelVehicule.
>
> Can any one help me on this point.
>
> This was the first point the second point concern extension to xml
> schema. If I define the complex type Car in another schema, how do I
> generate the class from this second schema if I have already
> generated the class Vehicule from the main schema. I mean how can I
> specify that Car inherit from Vehicule which is in another package ?
>
> Thank you
>
> Sylvain
>
>
>
>
>
>
>
>
>
>
>
> ___________________________________________________________________________
> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos
> questions ! Profitez des connaissances, des opinions et des
> expériences des internautes sur Yahoo! Questions/Réponses
> http://fr.answers.yahoo.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