At least in version 6.0.1 MapServer checks if a <Filter> or <ogc:Filter> tag was given in wfs_filter metadata and uses this. So you should be able to use <Filter> without a namespace prefix.
> -----Ursprüngliche Nachricht----- > Von: [email protected] > [mailto:[email protected]] Im Auftrag > von Michal Šrédl > Gesendet: Freitag, 6. Januar 2012 10:52 > An: [email protected] > Cc: Premysl Vohnout; Jachym Cepicky > Betreff: [mapserver-users] Mapserver <ogc:Filter> fails > against Geoserver WFS > > Dear all, > > I am not able to use WFS filter in Mapserver Mapfile against the > Geoserver WFS, apparently as Mapserver produces invalid XML as the > final filter that goes to the request. > > In Mapfile, I say > > LAYER > METADATA > "wfs_filter" '<ogc:PropertyIsEqualTo > xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyName>STUPE N</ogc:PropertyName><ogc:Literal>3</ogc:Literal></ogc:PropertyIsEqualTo>' > > (the whole Mapfile is attached) > > The request that leaves Mapserver towards the Geoserver WFS > looks like this: > > http://88.81.191.230:8080/geoserver/ows?&REQUEST=GetFeature&VE > RSION=1.0.0&SERVICE=WFS&TYPENAME=ccss:Flood2010_FloodActivityG rade&FILTER=<ogc:Filter><ogc:PropertyIsEqualTo+xmlns:ogc="http://www.opengis.net/ogc"><og> c:PropertyName>STUPEN</ogc:PropertyName><ogc:Literal>3</ogc:Li teral></ogc:PropertyIsEqualTo></ogc:Filter> > > Please note the <ogc:Filter> filter tag - with namespace used, but not > defined. This is an issue, as it is not valid and Geoserver replies > with an exception. > > Changing manually the filter tag either to <Filter> or > <ogc:Filter+xmlns:ogc="http://www.opengis.net/ogc"> makes the whole > thing work. Unfortunately, the Mapserver documentation [1] says, that > > "The filter given as a value of the wfs_filter metadata should not > contain <Filter> start and end tags." > > So whatever I provide as the "wfs_filter" value, is later broken by > <ogc:Filter> tag. > > Do you consider it a bug? Or is there any way how to make Mapserver to > create the filter as valid XML? Or let me include the <Filter> tag in > the "wfs_filter"? > > Thank you for your advice, > > Michal > > > Note: Mapserver itself wouldn't mind such a behaviour and would accept > such a request, e.g. this one: > > http://bnhelp.cz/cgi-bin/crwfs/cgi-bin/crwfs?&REQUEST=GetFeatu > re&VERSION=1.0.0&SERVICE=WFS&TYPENAME=okresy&FILTER=<ogc:Filte r><ogc:PropertyIsLessThan+xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyName>> KODOK</ogc:PropertyName><ogc:Literal>3555</ogc:Literal></ogc:P > ropertyIsLessThan></ogc:Filter> > > But Geoserver is not that tolerant... > > > [1] http://mapserver.org/ogc/filter_encoding.html > _______________________________________________ mapserver-users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/mapserver-users
