I have two SLD rules one using PropertyIsEqualTo and another using PropertyIsLike

Using PropertyIsEqualTo

          <Name>Vendor FirstVendor</Name>
                  <CssParameter name="fill">#0033CC</CssParameter>

Using PropertyIsLike

            <ogc:PropertyIsLike  wildCard="*" singleChar="." escape="!">

The SLD using Like works fine where as using equal does not work at all.I have seen the string in database well there is not leading or trailing spaces.

Geoserver is taking space at the end of literal. That was the issue. I added space to PropertyName eg Vendor_

  • Did you manage to find a solution to your problem. I seem to be having the exact same issue using PropertyIsEqualTo. I have looked at the resulting query that Geoserver creates and run this on the database. The database returns the results as expected but geoserver does not seem to render anything for the layer. Any help is much appreciated. Apologies for not posting this as a comment but it won't allow me to as I just created an account.
    – k9ty
    Commented Nov 23, 2012 at 14:30
  • 1
    @k9ty yes I found the solution the problem is there is some kind of bug or I don't know what's it the sld won't work you should use <ogc:Filter> <ogc:PropertyIsLike wildCard="*" singleChar="." escape="!"> <ogc:PropertyName>Vendor</ogc:PropertyName> <ogc:Literal>V1*</ogc:Literal> </ogc:PropertyIsLike> </ogc:Filter>
    – kinkajou
    Commented Nov 26, 2012 at 3:55
  • @k9ty here we have used the query "like" it the solution for now I guess. I could not solbe the problem with captDragon solution as there was validation error.
    – kinkajou
    Commented Nov 26, 2012 at 3:56

2 Answers 2


Try adding matchCase="true" like this:

<ogc:PropertyIsEqualTo matchCase="true">

I know it doesn't really make sense, but comparing yours to mine, that's the only difference i see.

  • 1
    Attribute 'matchCase' is not allowed to appear in element 'ogc:PropertyIsEqualTo'
    – kinkajou
    Commented Feb 29, 2012 at 3:59
  • What is not allowing you? It's part of the OGC spec.
    – CaptDragon
    Commented Feb 29, 2012 at 13:40
  • it works partially but geoserver validate button generates error
    – kinkajou
    Commented Mar 1, 2012 at 4:58
  • What's the error? And do you have this xmlns:ogc="http://www.opengis.net/ogc" at the top of the xml file?
    – CaptDragon
    Commented Mar 1, 2012 at 13:54
  • 1
    "Attribute 'matchCase' is not allowed to appear in element 'ogc:PropertyIsEqualTo'" This is the error :)
    – kinkajou
    Commented Mar 7, 2012 at 4:40

This answer is quite late but I was just struggling with this same issue.

I used "excapeChar" instead of "escape" and GeoServer accepted it:

<ogc:PropertyIsLike wildCard="%" singleChar="#" escapeChar="!">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.