Mauro Bartolomeoli ha scritto:
> I have a problem with a WFS GetFeature request:
> 
> <GetFeature service="WFS" version="1.0.0" outputFormat="GML2" 
> xmlns:gml="http://www.opengis.net/gml"; 
> xmlns="http://www.opengis.net/wfs"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://www.opengis.net/wfs 
> http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd"; 
> xmlns:ogc="http://www.opengis.net/ogc";>
>    <Query xmlns:jesi20="http://www.esalab.it/jesi20"; 
> typeName="jesi20:CATPARTICELLE">
>        <PropertyName>CHCATPARTICELLE</PropertyName>
>        <PropertyName>GEOMETRY</PropertyName>
>        <Filter>
>            <PropertyIsEqualTo>
>                <PropertyName>CHCATPARTICELLE</PropertyName>
>                <Literal>E388337108002</Literal>
>            </PropertyIsEqualTo>
>        </Filter>
>    </Query>
> </GetFeature>
> 
> 
> The problem is that the <PropertyName> tag in the Filter is parsed as a 
> Literal, not as a PropertyName.
> Everything is parsed correctly if I change the request to:
> 
> <GetFeature service="WFS" version="1.0.0" outputFormat="GML2" 
> xmlns:gml="http://www.opengis.net/gml"; 
> xmlns="http://www.opengis.net/wfs"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:schemaLocation="http://www.opengis.net/wfs 
> http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd"; 
> xmlns:ogc="http://www.opengis.net/ogc";>
>    <Query xmlns:jesi20="http://www.esalab.it/jesi20"; 
> typeName="jesi20:CATPARTICELLE">
>        <PropertyName>CHCATPARTICELLE</PropertyName>
>        <PropertyName>GEOMETRY</PropertyName>
>        <Filter>
>            <PropertyIsEqualTo>
>                <ogc:PropertyName>CHCATPARTICELLE</ogc:PropertyName>
>                <Literal>E388337108002</Literal>
>            </PropertyIsEqualTo>
>        </Filter>
>    </Query>
> </GetFeature>
> 
> adding the ogc namespace prefix to PropertyName.
> Is this a bug? Where can I look in the code to try to fix it?

Actually no, it's not, only the second request is correct. You're
declaring "http://www.opengis.net/wfs"; as the default namespace, whilst
the filter elements do reside in the ogc namespace. The parser is 
looking for an OGC:PropertyName element as a child of the filter
and failing... probably due to the fact there is a wfs omonimous.
The totally correct way to setup the filter would be to use
ogc: prefix for all elements under filter (Filter included).

Cheers
Andrea

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to