Castor maps the value of the <Schema> "targetNamespace" attribute to a
Java package via the entries in the castorbuilder.properties. An example
is shown in this file currently. So to build up the package hierarchy
you want you must have each schema in its own namespace and use
<xsd:import> to share types between them. Have fun!

-----Original Message-----
From: John Hughes [mailto:[EMAIL PROTECTED] 
Sent: 18 December 2003 20:37
To: [EMAIL PROTECTED]
Subject: [castor-dev] schema hierachy and insertion of import statements

I have an environment where I have wish to build classes out of a
hierarchy of XML schemas.  However I cant seem to get Castor to create
Java classes with import statements for lower level packages.  I've
tried various combinations of the use of <import> and <include> in the
schema file to no avail.

Simplified this is what I have:

schema1 imports schema2.  Schema 1 and Schema2 have different name
spaces (and hence I cant use the <include> directive. When building each
schema I supply a different package name.  I want to create a package
hierarchy as
follows:

com.entegrity.parent
com.entegrity.parent.schema1
com.entegrity.parent.schema2

Hence the schema1 and schema2 class files will be in separate packages -
and under the same root.

The basic problem is that none of the schema1 java files have statements
to import the schema2 files.

Is there any way to automatically cause Castor to include them - or do I
manually have to handcraft the java source files.


John

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




The information in this message is confidential and may be legally privileged.  It may 
not be disclosed to, or used by anyone other than the addressee.  If you receive this 
message in error, please advise us immediately.

Internet emails are not necessarily secure.  CODA does not accept responsibility for 
changes to any email which occur after the email has been sent.  Attachments to this 
email may contain software viruses, which could damage your systems.  CODA has checked 
the attachments for viruses before sending but you should virus-check them before 
opening.

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

Reply via email to