Hello Wei,

> I'm quite new to castor and my knowledge of castor is 
> limited.  I have been
> wandering if the current castor provides a "more" automatic way of
> generating the source code in the following situation:
> 
> (a)
> - DTD schema are defined.

No, you have to convert your DTD to XML schema (The furture is anyway xsd
instead of dtd).

> - Use SourceGenerator to generate classes and class descriptors
> 
> (b)
> - Have my own classes that are inherited from the generated ones.

Yes, configure the castorbuilder.properties file with your own supar class.
A example
of that file can be found in the source distribution. Look in the package
'org.exolab.castor.builder'. To make use of your edited version of this
properties, include
it in your classpath, before the castor package!

> - When unmarshalling xml to objects, I would like to map the 
> xml elements to
> the classes of my own rather than generated ones.

Use the castor Mapping stuff for this
(http://castor.exolab.org/xmlschema.html). 

> The mechanism that I currently use is to create the 
> description classes of
> my own classes. These description classes are a copy of the 
> generated ones,
> except the class names that refer to the generated ones are 
> replaced with my
> own.
> For example,
>   -the castor generator generates the Building and BuildingDescriptor
> classes.
>   -BuildingNew class extends Building class.
>   -BuildingNewDescriptor is the same as BuildingDescriptor, 
> except all the
> references to Building class/object are now to BuildingNew 
> class/object.
> 
> My question is that is there a way to tell the castor source 
> code generator
> such that, when unmarshalling, the X1 xml element is always 
> mapped to X1New,
> Y1 to Y1New, etc.

Sorry, I don't have that mutch Castor mapping experience.

You are asking a lot of technical questions, but could you explain what you 
realy try to solve / do. 
For me it's not clear what your read problem (/ project) is. I get the
feeling that 
you try to solve something which maybe could be solved easier. But for now
it is 
difficult to gain a comprehensive view of the real problem.


Tjeerd

This e-mail and any attachment is for authorised use by the intended recipient(s) 
only.  It may contain proprietary material, confidential information and/or be subject 
to legal privilege.  It should not be copied, disclosed to, retained or used by, any 
other party.  If you are not an intended recipient then please promptly delete this 
e-mail and any attachment and all copies and inform the sender.  Thank you.

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to