Hello,

---Chris Newland wrote:
[...]
> I am trying to use the SourceGenerator to generate Java code for 2 classes
> into 2 different packages by defining them as elements in the same XML
> schema:
[...]

In order to create 2 different packages you must have separate
namespaces in your schema. The simplest way to achieve this is
to define 2 schemas, one importing the other like this:

=======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://www.foo.com/bar";
xmlns:bar="http://www.foo.com/bar";
xmlns:baz="http://www.foo.com/baz";>

<import
  namespace="http://www.foo.com/baz";
  schemaLocation="http://www.foo.com/baz"/>

        <element name="BarType">
                <complexType>
                        <sequence>
                                <element name="name" type="string"/>
                                <element ref="baz:BazType"/>
                        </sequence>
                </complexType>
        </element>
</schema>
=======================================================================
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://www.foo.com/baz";
xmlns:baz="http://www.foo.com/baz";>

        <element name="BazType">
                <complexType>
                        <sequence>
                                <element name="name" type="string"/>
                        </sequence>
                </complexType>
        </element>
</schema>
=======================================================================

Then the properties you've defined into castorbuilder.properties file
will ensure that you'll have separate packages.

I hope this helps...

Best regards from France,
-- 
[EMAIL PROTECTED] - http://www.bigfoot.com/~alexandre.nouvel
_______________________________________________________________________
Les eMails commerciaux non sollicites | Unsollicited commercial eMails
  sont soumis a une taxe de 1000$US.  |  are subject to a US$1000 fee.

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

Reply via email to