Hi Mike,

I'll see if I can code up a quick example for you (and others) once I have a spare moment to do so. I don't have anything readily available that I can send you that demonstrates how to do it.

The basic steps are:

1. Define seperate namespaces for each schema

2. Import one schema into the other
   (make sure to use import, not include)

3. Make sure to use the proper namespace prefixes when references imported declarations and definitions.

4. Declare each namespace from step 1 in a castorbuilder.properties file using:

org.exolab.castor.builder.nspackages=\
        http://acme.com/namespace1, \
        http://acme.com/namespace2

5. Generate the source code for each schema (this can be done together by generating the source for the main schema and specifying the flag for processing includes).

Again, I'll try and code up a quick example, but I won't be able to get to it right away.

--Keith

Mike Kopack wrote:
Keith,

Thanks for the help. I'm a bit of a dummy when it comes to the whole namespace stuff. I use XMLSpy to write the schemas and whenever I tried to do the namespace stuff for the shared elements schema and then the children it complained.

Could you possible shoot me a quick example of how to do the namespace stuff so it'll work and an example of a castorbuilder.properties that matches?

I'd appreciate it.

Thanks!

--Mike

Keith Visco wrote:

Hi Mike,

This can be done. And yes it does matter if you use include instead of import because include acts as a "inlining" and treats everying in the included schema as if it was part of the including schema. <import> is what you want to use. Schema B and C will need it's own targetNamespace and you'll need to set up your namespace to package mappings in the castorbuilder.properties file so that Castor knows how to generate the correct code.

--Keith


Mike Kopack wrote:

Hey gang,

I'm new to Castor and I'm having a hard time getting it to generate the classes the way that I need them to. What I have is the following:

Schema A - defines a set of complexTypes, simpleTypes and some shared Elements.

Schemas B and C - different schemas that make use of the types and elements defined in A, through either an import or include.


What I NEED to have Castor do is generate 3 packages:

package A - containing the code/classes for everything in A.
package B - containing the code/classes for B, with references as needed to the classes in package A (ie, not make it's own local package copy of things defined in A) package C - containing the code/classes for C, with references as needed to the classes in package A (ie, not make it's own local package copy of things defined in A)

When I try to do this, Castor always spits out package A, then packages B and C with all the same elements as A in their own package (plus their B and C specific classes).

Is there any way to fix that???

Also, does it matter if I do an Import rather than an Include?

Thanks!

--Mike



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------







-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to