Thanks, Keith. I see what you mean.
I definitely thought of using SOM, but was wondering how tightly coupled the
Java source generation was to the SourceGen.
Ozgur

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Keith Visco
Sent: Tuesday, January 22, 2002 1:48 AM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] generating sth other than java code




Ozgur Balsoy wrote:
>
> Is it possible to generate some other type of code instead of Java source
> code using SourceGenerator?

Not really...you might be able to modify it to produce source for
another object oriented programming language, with some heavy
modifications, but it would take some work.

>
> Let's say I want to obtain some schema documentation pages and I want to
> give the SourceGen the XSD file and obtain HTML files? How easy is it to
> change? Or, what classes should I provide?

No this won't really work. Castor reads the XML Schema into a Schema
Object Model (SOM). The SOM is traversed and a set of intermediary
classes are created (ClassInfo/FieldInfo) that hold the information
needed to create the Java classes. Each intermediary class is then
converted to an in memory representation of the Java source code using
the org.exolab.javasource package and then written to disk.

You can certainly use the Schema Object Model from Castor, but the other
steps are really tied into creating source code and specifically Java
source code.

With some modifications you could probably use the intermediary classes
(ClassInfo/FieldInfo) for a package that might produce C++ or Python for
example, but you would need the equivalent library for those languages
as the org.exolab.javasource library is for java.

In any case...it would involve a lot of work, and would probably be
easier to write something from scratch...

The only thing really reusable would be the Schema Object Model...since
of course you want to convert a Schema to something else.

--Keith

-----------------------------------------------------------
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