This command line will generate a version of the schema that depends on 
the opengis bundle.  It also saves a local copy of the schemas it has to 
download, in case it's useful to examine them manually.

pyxbgen \
    --uri-content-archive-directory downloaded \
    --archive-path '&pyxb/bundles/opengis//:+' \
    --schema-location 
http://www.aixm.aero/gallery/content/public/schema/5.0/AIXM_Features.xsd \
    --module test

Note the need to place the archive-path argument in single quotes so the 
ampersand that denotes the PyXB installation directory does not get 
interpreted as a Unix shell run-in-background operator.  This does 
assume you've installed either the full PyXB distribution, or have 
downloaded the opengis overlay.

Documentation on the archive path capability can be found at 
http://pyxb.sourceforge.net/api/pyxb.namespace.archive-module.html#PathEnvironmentVariable

Peter


On 1/26/2010 8:00 PM, Peter A. Bigot wrote:
> The -u (--schema-location) and -m (--module) parameters need to come in
> pairs, since the -m argument names the Python module that should be used
> to store the XML structures associated with the namespace that is the
> target of the -u schema.  I expect that's the cause of the error.  You
> can make this work with:
>
> pyxbgen \
>      -u
> http://www.aixm.aero/gallery/content/public/schema/5.0/AIXM_Features.xsd  \
>      -m test
>
> Just drop the second parameter; PyXB can find the other schemas by
> itself.  This successfully builds a module; I haven't tested it in any way.
>
> The error is misleading, and there should be a bug filed to make sure
> something more useful gets printed.  Also, it should be possible to
> re-use the xlink and gml bindings that are part of the opengis bundle,
> instead of creating local private modules.
>
> Peter
>
> On 1/26/2010 2:09 PM, Wendell Turner wrote:
>    
>> I'm new to PyXM and am trying to generate parsers from some
>> .xsd files.  The command I'm using is this:
>>
>>     pyxbgen -u 
>> http://www.aixm.aero/gallery/content/public/schema/5.0/AIXM_Features.xsd \
>>      -u 
>> http://www.aixm.aero/gallery/content/public/schema/5.0/ISO_19136_Schemas/ \
>>      -m test
>>
>> However, it ends with this assertion error:
>>     assert tns is not None
>>
>> Is the above the correct command to use to generate the
>> parser?  Is the schema valid?  What is the namespace that
>> pyxb is complaining about?
>>
>> (I think the schema files were generated with Rational Rose,
>> and seem to reference xmlbeans.  Does that matter?)
>>
>> Thanks,
>>
>> Wendell
>>
>>
>> ------------------------------------------------------------------------------
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>> _______________________________________________
>> pyxb-users mailing list
>> pyxb-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pyxb-users
>>
>>      
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> pyxb-users mailing list
> pyxb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyxb-users
>    



------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to