Thanks Peter for your fast response,
I looked at pyxbgen userref, but I didn't see that the error was different
and there was an error of xsd files, I'll send a patch to a producer of
these xsd files.
The process I run and works fine:
$ pyxbgen -u SimpleTypes.xsd -m SimpleTypes --archive-to-file
SimpleTypes.wxs
Complex Types also depends on SimpleTypes
$ pyxbgen -u ComplexTypes.xsd -m ComplexTypes --archive-to-file
ComplexTypes.wxs --archive-path .:+
Finally I can generate Model1 and Model2 by:
$ pyxbgen -u Model1.xsd -m Model1 --archive-path .:+
$ pyxbgen -u Model2.xsd -m Model2 --archive-path .:+
Cheers
2010/10/1 Peter Bigot <big...@acm.org>
> Take a look at http://pyxb.sourceforge.net/userref_pyxbgen.html,
> specifically the section on multi-document schema and sharing namespace
> bindings. You probably need to generate modules for SimpleTypes and
> ComplexTypes, then reference those in the modules for Model1 and Model2.
>
> If that doesn't get you anywhere, please create a new ticket on
> https://sourceforge.net/apps/trac/pyxb/ and attach to that ticket a tar or
> zip file containing the schema you are using.
>
> Peter
>
> On Fri, Oct 1, 2010 at 11:15 AM, Eduard Carreras <ecarre...@gisce.net>wrote:
>
>> Hello,
>> I get this exception when importing generated models. Firstly I remark
>> that I'm only the consumer of this XSDs, I can't modify its structure...
>>
>> Example:
>> SimpleTypes.xsd
>> ComplexTypes.xsd
>> Model1.xsd
>> Model2.xsd
>>
>> Model1.xsd and Model2.xsd both have a <xs:include
>> schemaLocation="SimpleTypes.xsd"/> and <xs:include
>> schemaLocation="ComplexTypes.xsd"/> inside.
>>
>> I use pyxbgen to generate python modules as following:
>> $ pyxbgen -u Model1.xsd -m Model1
>> $ pyxbgen -u Model2.xsd -m Model2
>>
>> Then using ipython in the same directory:
>>
>> import Model1 (ok, no exception raised)
>>
>> import Model2 (NamespaceUniquenessError used for multiple values in
>> typeBinding)
>>
>> I can attach original xsd files if you want to reproduce this problem.
>>
>> Cheers,
>>
>> --
>> Eduard Carreras i Nadal <ecarre...@gisce.net>
>> Tel. 972 911 566 - Fax 972 217 384
>> GISCE-ENGINYERIA S.L.
>>
>>
>> ------------------------------------------------------------------------------
>> Start uncovering the many advantages of virtual appliances
>> and start using them to simplify application deployment and
>> accelerate your shift to cloud computing.
>> http://p.sf.net/sfu/novell-sfdev2dev
>> _______________________________________________
>> pyxb-users mailing list
>> pyxb-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pyxb-users
>>
>>
>
--
Eduard Carreras i Nadal <ecarre...@gisce.net>
Tel. 972 911 566 - Fax 972 217 384
GISCE-ENGINYERIA S.L.
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security
easier or more difficult to achieve? Read this whitepaper to separate the
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users