Hi Werner,

Oliver,

Just picking up on the last point (as already asked): do you have a few samples that highlight your current problems ?
Yes :-) Yesterday I managed to modify my initial example to work with the CodeGenerator.

Sorry about the delay, but in the last three days I had to work in the mornings. The requirements concern my thesis project (DFKI), that isn't rewarded with any money :-(

Here it comes, AType is superclass of BType (normaly there is a smooth inheritance behavior a not so may changes in the subclass):

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="qualified" attributeFormDefault="unqualified">
   <xs:element name="A" type="AType" abstract="true"/>
   <xs:complexType name="AType">
       <xs:sequence>
           <xs:element name="e1" type="C" maxOccurs="unbounded"/>
           <xs:element name="e2" type="D" maxOccurs="unbounded"/>
       </xs:sequence>
   </xs:complexType>
   <xs:element name="B" type="BType" substitutionGroup="A"/>
   <xs:complexType name="BType">
       <xs:complexContent>
           <xs:restriction base="AType">
               <xs:sequence>
                   <xs:element name="e1" minOccurs="0">
                       <xs:simpleType>
                           <xs:restriction base="C">
                               <xs:enumeration value="1"/>
                           </xs:restriction>
                       </xs:simpleType>
                   </xs:element>
                   <xs:element name="e2" maxOccurs="2">
                       <xs:simpleType>
                           <xs:restriction base="D">
                               <xs:enumeration value="example"/>
                           </xs:restriction>
                       </xs:simpleType>
                   </xs:element>
                   <xs:element name="e3" type="xs:string"/>
               </xs:sequence>
           </xs:restriction>
       </xs:complexContent>
   </xs:complexType>
   <xs:simpleType name="C">
       <xs:restriction base="xs:int"/>
   </xs:simpleType>
   <xs:simpleType name="D">
       <xs:restriction base="xs:string"/>
   </xs:simpleType>
</xs:schema>

I can't generate this kind of schema with the current API, cause I don't manage to insert constructs like complexContent + restriction. So I need to know if there are any constructing methods for this or if you can extend the API for that purpose?

Oliver
Werner

-----Ursprüngliche Nachricht-----
desired java code on the basis of my reference schema. But because I
can't generate this corresponding schema constructs with the Castor API
my efforts stagnate a bit.

Best Regards,
Oliver

-----Original Message-----
From: Oliver Fourman [mailto:[EMAIL PROTECTED]
Sent: March 6, 2007 1:45 AM
To: [email protected]
Subject: Re: [castor-user] Use of superclass for source generation

Hi Srdjan,

    I am interested in your schema that deals with super classes. Can
you post an example?
Last week I posted a similar question concerning this object:
http://archive.castor.codehaus.org/user/45E72825.80102%40dfki.de
http://archive.castor.codehaus.org/dev/45E7FD70.4050401%40dfki.de
My goal is to define types, that extends / restrict other types in my
schema. Next, I'm also interested what the Castor CodeGen does with such
types when translating them into the oo world.

Do you know any good lists where such xml schema topics are discussed?

Best regards,
Oliver

Srdjan Djuricic schrieb:

Hello,

I am generating java classes from the XML schemas and I am also
setting a super class to all the generated classes.  Besides just
having classes that extend the supertype is it possible to somehow
include the properties of the super class in the class descriptions so

that when I am marshalling a java object properties inherited from the

supertype would be included in the marshalled output?  I know I am
probably asking for too much here :)

Thanks,

Srdjan



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

   http://xircles.codehaus.org/manage_email

Reply via email to