Jason,
When you generate your java classes you will end up with one for the
elements in your xsd, and each of those will have a corresponding
"Descriptor" class generated. These descriptor classes are used for xml
serialization by default, so no extra mapping is needed justt for
serialization. An additional mapping is needed if you decide to use JDO for
persistence...

HTH -
Margaret

-----Original Message-----
From: Jason van Zyl [mailto:jason@;zenplex.com]
Sent: Thursday, October 24, 2002 6:35 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] XSD and XML Marshalling


Hi,

I have a use case where I am generating a set of Java sources for a set
of message types, each type being described by an XSD file. An instance
of a message type will be manipulated in Java and subsequently needs to
be persisted in XML form. A common use case for Castor users I imagine.

So I am using the SourceGenerator tool to produce the Java sources but I
was wondering what the best way is to create a mapping.xml file. I see
the option that will place the marshalling code into the classes but to
marshall an instance to XML do I still need the mapping.xml file?

If possible, ideally what I would like is to essentially have the
generated Java sources just be data storage. Persistence to XML is only
one potential location so I would like to keep the Castor specific
marshalling functionality outside the generate sources if at all
possible. I'm using Betwixt to marshall some less complicated messages
and we use TopLink to persist to DBs.

So in summary I require:

1. Generation of Java sources from an XSD file.

2. I would like the generated sources to be as lean as possible and
essentially be data store and entry point for application development
for a particular message type.

3. I would like to generate a mapping.xml file for the generated Java
sources. I assume we have a corollary happening here in that if the Java
sources are being generated from the XSD file and implicit somewhere is
the information that would go into the mapping.xml file. Is that
correct?

4. I would like to be able to use the mapping.xml file at run-time to
persist the instances.

What is the best way to go about satisfying the requirements listed
above?

The other questions I had are:

1. What exactly are the descriptors that can optionally be included in
the sources.

2. Does the MappingTool use these descriptors to produce a mapping.xml
file?



-- 
jvz.

Jason van Zyl
[EMAIL PROTECTED]
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society

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

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

Reply via email to