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

Reply via email to