The best way to deal with this is to create a single schema that just
includes both B.xsd and C.xsd, and generate the bindings using it.  A.xsd
will come along for the ride.  Since B and C represent objects in the same
namespace, they really need to be generated into a single Python module, and
PyXB expects a one-to-one namespace/module correspondence.  The tool doesn't
directly provide a way to merge schema without a helper schema like this.

Though there are situations where two schema in the same namespace can be
inconsistent with each other, that's not a wise practice, and presumably
doesn't arise here because then it would be inconsistent to use both in the
same Python program too.

Peter

On Tue, 12 Jan 2010, Romain CHANU wrote:
> Hi,
>
> Let's say we have three XML schemas: A.xsd, B.xsd, C.xsd. A.xsd is included
> (with the include directive) in B.xsd and also in C.xsd
>
> I generate the bindings for B and C. I got two Python files B.py and C.py
>
> If I import "B" and "C" in the same Python file, it will result in an error
> saying that some types (those defined in A.xsd) have multiple definitions
> (note that i am using the same namespace in the three schemas).
>
> Is there a way to handle this situation?
>
> Thank you for your help.
>
> Cheers,
>
> Romain
>


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
pyxb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to