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:
<Style>
<Name>ref_cad:app_cadastrapp_parcelle</Name>
<LegendURL width="20" height="20">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http: xlink:type="simple" xlink:href="" class="code-quote" style="color: #009100">"https://portail.sig.rennesmetropole.fr/geoserver/ows?service=WMS&request=GetLegendGraphic&format=image%2Fpng&width=20&height=20&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:
$ xmllint --valid --schema http:[...]
extra-prod-getcap.xml:5479: element LegendURL: Schemas validity error : Element '{http:: 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:: 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. |