Can I set the title of an SLD rule using a feature's field?

I have a very dynamic dataset where the value of a polygon changes after each update, therefore I need to be able to compare using one field and label the style rule with another field to create a legible legend.

Below I have a rule using the SLD syntax. I am able to use a PropertyName tag to compare two values, is it possible to similarly use a PropertyName tag (or equivalent) to change the Description's Title tag?

      <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
          <se:SvgParameter name="fill">#820000</se:SvgParameter>
          <se:SvgParameter name="stroke">#000001</se:SvgParameter>
          <se:SvgParameter name="stroke-width">1</se:SvgParameter>
          <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>

In GeoServer simply adding a PropertyName tag returns the following:

Element 'se:Title' is a simple type, so it must have no element information item [children].

I've tried adding a function within the tag and get the same result. Adding a PropertyName tag within the Description tag returns:

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

  • 1
    What did you try? What happened when you did that?
    – Ian Turton
    Commented Jun 25, 2018 at 17:14
  • I'm asking a general question about what is possible within the SLD syntax. Can you pull a field from a feature and use it as a title instead of setting a static title?
    – WxPilot
    Commented Jun 25, 2018 at 18:23
  • 1
    Please take the tour and get a feel for the sort of questions that we like around here.
    – Ian Turton
    Commented Jun 25, 2018 at 18:27
  • 1
    why not try this out for yourself?
    – Ian Turton
    Commented Jun 25, 2018 at 18:59
  • 1
    I did, and I'll go ahead and add that additional information. I was trying to keep the syntax and question clean to make the post useful for others with the same issue.
    – WxPilot
    Commented Jun 25, 2018 at 19:04

1 Answer 1


No, a rule title cannot be feature dependent, it's a static element that cannot depend on features (a single rule normally matches many, and the rule title is also used to generate legends, in complete absence of features).

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.