Hi, please see inline.
Werner Sachith Dhanushka wrote: > Hi Werner and all, > > Finally I can now start the project :) > > Anyway, I looked more deeper in to what I have to do and these are some > initial ideas. Please help me to clarify these. > > 1. The basic idea is to look at a set of JAXB2 generated classes and > from that gather information, pump them in to Castor to generate code. > So what I thought was to create an instance of > org.exolab.castor.xml.schema.Schema object and populate it from the > information extracted from JAXB2. Yes and no. The idea is to assess a collection of Java classes (annotated with JAXB annotations), and create a schema convertor that is capable of creating an XML schema instance from those classes. There's the JAXB specification that has a longish section about this schema converter, and we simply need to meet those requirements. Basically, that converter needs to be able to read on those Java classes, and build a Schema instance from it, based upon the semantics as defined by the Java model and the JAXB annotation. As you have already figured, Castor already has Java classes that we use internally to represent XML schema information. These classes are used during source code generation, for reading in an XML schema from e.g. a file. Part of your task package will be to use these classes (and expand them as required) to build an in-memory representation of an XML schema, and eventually serialize it to a file. > This Schema object can be fed in to > Castor source generator to generate java sources. The method I am > looking to hook this is SchemaGenerate.generateSource(final Schema > schema, final String packageName)+ This is the other way around, Java code generation from an XML schema, and that part is *not* within scope for you. > > 2. JAXB2 comes with a java-to-schema converter. I didn't look at it > much, but I think I can either > I. hack in to that and plugin castor Schema object to get it populated or > II. let it generate a schema and pump it in to SchemaGenerate in Castor. I don't think hacking into the JAXB schema convertor is actually anm option. In order to offer JAXB 2.0 compliance for Castor XML, Castor needs to have its own schema convertor that meets the requirements as set our by the JAXB specification. > So these are the paths that I will be exploring to achieve the goal. > Please help me to refine these ideas and to achieve what you wanted to > achieve from this project. > > Thanks, > SD --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email