[mapserver-dev] wfs-GetFeature-request: Failed to parse expression: "" != "''"

Bjoern Schilberg bjoern.schilberg at intevation.de
Mon May 9 08:44:02 EDT 2011


Hej,

i got a problem in MapServer version 5.6.6 with <ogc:Literal>''</ogc:Literal>
in combination with logical Operator <ogc:And>.

If i try to post the following wfs-GetFeature-request:

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Query typeName="feature:projects" 
xmlns:feature="http://mapserver.gis.umn.edu/mapserver">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:And>
<ogc:PropertyIsLike wildCard="*" singleChar="." escape="!">
<ogc:PropertyName>lebensraum</ogc:PropertyName>
<ogc:Literal>Waelder and Alleen</ogc:Literal>
</ogc:PropertyIsLike>
<ogc:PropertyIsNotEqualTo>
<ogc:PropertyName>kp_naturschutz</ogc:PropertyName>
<ogc:Literal>''</ogc:Literal>
</ogc:PropertyIsNotEqualTo>
</ogc:And>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

I got the following response:

<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
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
http://mapserver.gis.umn.edu/mapserver
http://server.com/fcgi-bin/wms.fcgi?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=feature:projects&amp;OUTPUTFORMAT=XMLSCHEMA">
<gml:boundedBy>
<gml:null>missing</gml:null>
</gml:boundedBy>
</wfs:FeatureCollection

In the mapserver logs i found this error message:

msEvalExpression: Expression parser error. Failed to parse 
expression: "" != "''"

If i modified the above wfs-GetFeature-request and write

<ogc:Literal></ogc:Literal> instead of <ogc:Literal>''</ogc:Literal>.

everything is fine and i got the corresponing results. 

But i'm confused.

If i send a wfs-GetFeature-request with ONLY the comparison operator 
<ogc:PropertyIsNotEqualTo> and <ogc:Literal>''</ogc:Literal>
WITHOUT the logical operator <ogc:And> it works!

Why does a wfs-GetFeature-request with <ogc:Literal>''</ogc:Literal> in 
combination with <ogc:And> not work?


bj

MapServer version 5.6.6 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE
SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=SOS_SERVER
SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


More information about the mapserver-dev mailing list