We're updating the issue view to help you get more done. 

WMS1.3.0 SLD definition can break getcapabilities

Description

Observed by a customer:

When a SLD is defined without a Title nested in the Description element (which is compliant in regard to the SLD specifications, relying on https://github.com/geotools/geotools/blob/master/modules/library/api/src/main/java/org/geotools/styling/Style.java#L39), the Description object used in the GetCapabilities generation can have a title set to null, ending up with a missing Title element:

1 2 3 4 5 6 7 <Style> <Name>ref_cad:app_cadastrapp_parcelle</Name> <LegendURL width="20" height="20"> <Format>image/png</Format> <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="https://portail.sig.rennesmetropole.fr/geoserver/ows?service=WMS&amp;request=GetLegendGraphic&amp;format=image%2Fpng&amp;width=20&amp;height=20&amp;layer=ref_cad%3Aapp_cadastrapp_parcelle"/> </LegendURL> </Style>

This might break the GetCapabilities XSD compliance. Here is a result of xmllint on the Getcapabilities output:

1 2 3 4 5 6 $ xmllint --valid --schema http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd extra-prod-getcap.xml [...] extra-prod-getcap.xml:5479: element LegendURL: Schemas validity error : Element '{http://www.opengis.net/wms}LegendURL': This element is not expected. Expected is ( {http://www.opengis.net/wms}Title ). [...] extra-prod-getcap.xml:5486: element LegendURL: Schemas validity error : Element '{http://www.opengis.net/wms}LegendURL': This element is not expected. Expected is ( {http://www.opengis.net/wms}Title ). extra-prod-getcap.xml fails to validate

Proposition: one possible fix would be to reuse the SLD name if Description.title null, since the Title element needs to be in the GetCapabilities response.

Environment

Debian Linux 7, tomcat 6, Java 7

Status

Assignee

Unassigned

Reporter

Pierre Mauduit

Triage

None

Fix versions

Affects versions

2.8.3

Components

Priority

Low