users@jaxb.java.net

RE: JAXB multiple namespaces and packaging

From: Aleksandar Likic <ALikic_at_loyalty.com>
Date: Thu, 22 Jul 2004 10:29:42 -0400

OK, I was missing the

 

            <jaxb:schemaBindings>

                <jaxb:package name="myPackage"/>

            </jaxb:schemaBindings>

 

customization. It solved my problem.

 

Aleksandar Likic

www.loyalty.com <http://www.loyalty.com>

 

-----Original Message-----
From: Aleksandar Likic
Sent: Wednesday, July 21, 2004 1:41 PM
To: 'users_at_jaxb.dev.java.net'
Subject: JAXB multiple namespaces and packaging

 

Hi,

I am planning to implement a framework component that operates on class A,
where class A is a result of JAXB compilation of A.xsd which has defined
element A. I want to package the framework component in a .jar file, to use
it in my application. The application uses class B, where class B is a
result of JAXB compilation of B.xsd which has defined element B. Schema
B.xsd imports A.xsd, for element B has an inner element of type A.

Schema A and B have different namespaces. When I compile A.xsd, class A ends
up in in package "a". When I compile B.xsd, classes A and B end up in
package "b". My framework component operates on a.A.class. In application,
when I unmarshal element B and do b.getA(), I assume I will get an instance
of b.A.class. I assume my framework component will throw ClassCastException
when used in my application.

Is my assumption correct, and if it is what would be the solution to my
problem?

Thanks,

 

Aleksandar Likic

www.loyalty.com <http://www.loyalty.com>