Using Geoserver 2.2.2 (GeoTools Version 8.4) on Windows 7, I'm trying to create a SLD that trims the leading and trailing spaces of a string property (using the strTrim function) and compares it to a given string pattern (using PropertyIsLike) for filtering. Here is the code:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" 
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" 

            <ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
              <ogc:Function name="strTrim">
              <CssParameter name="fill">#FF8C00</CssParameter>
              <CssParameter name="fill-opacity">0.6</CssParameter>


When validating the SLD, I get the following error:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'ogc:Function'. One of '{"http://www.opengis.net/ogc":PropertyName}' is expected.

Where is the mistake?

1 Answer 1


This was caused by a GeoTools bug and the fix will be available in GeoTools versions 20 and beyond.

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.