Cool, thanks a lot!
On Tue, May 10, 2016 at 12:31 AM, Peter Bigot <pabi...@gmail.com> wrote:
> QName values must be expanded names, incorporating both the namespace and
> the local name.
>
> import pyxb.bundles.opengis.csw_2_0_2 as csw;
>
> import pyxb.utils.domutils;
> pyxb.utils.domutils.BindingDOMSupport.DeclareNamespace(csw.Namespace,
> 'csw')
>
> q1 = csw.Query(typeNames=[csw.Namespace.createExpandedName('Record')]);
> q1.ElementSetName = 'brief';
> print q1.toDOM().toprettyxml();
>
>
> producing
>
> <?xml version="1.0" ?>
> <csw:Query typeNames="csw:Record" xmlns:csw="
> http://www.opengis.net/cat/csw/2.0.2">
> <csw:ElementSetName>brief</csw:ElementSetName>
> </csw:Query>
>
>
> On Mon, May 9, 2016 at 10:20 AM, Ricardo Filipe Soares Garcia da <
> ricardo.garcia.si...@gmail.com> wrote:
>
>> Hi Peter, all
>>
>> I'm trying to use pyxb with the opengis schemas to work with the CSW
>> 2.0.2 standard[1].
>> I have PyXB 1.2.4 installed with the opengis schemas, which I installed
>> following the steps described in the docs[2]. Now I'm trying to create a
>> Query element using something like:
>>
>> from pyxb.bundles.opengis import csw_2_0_2
>> q1 = csw_2_0_2.Query(typenames="csw:Record")
>>
>> This fails with a QNameResolutionError. I guess I have to tell pyxb about
>> the csw prefix somehow, but I've not been able to figure out how to do it.
>>
>> Interestingly, if I try with:
>>
>> q1 = csw_2_0_2.Query(typenames="Record")
>>
>> it does work. however, I do need to be able to also supply the include
>> the "csw" prefix as it is mentioned in the standard.
>>
>> How can I do it?
>>
>>
>> Best regards
>>
>>
>> [1] - http://www.opengeospatial.org/standards/cat
>> [2] -
>> https://github.com/pabigot/pyxb/blob/next/pyxb/bundles/opengis/README.txt
>>
>> --
>> ___________________________ ___ __
>> Ricardo Garcia Silva
>>
>>
>> ------------------------------------------------------------------------------
>> Find and fix application performance issues faster with Applications
>> Manager
>> Applications Manager provides deep performance insights into multiple
>> tiers of
>> your business applications. It resolves application problems quickly and
>> reduces your MTTR. Get your free trial!
>> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>> _______________________________________________
>> pyxb-users mailing list
>> pyxb-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pyxb-users
>>
>>
>
--
___________________________ ___ __
Ricardo Garcia Silva
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users