The demo styles in "ne" workspace do not validate
Description
Environment
Activity
Jody Garnett February 15, 2023 at 6:46 AM
This is as fixed as it can be; should open a ticket about vendor options being impossible to validate.
Jody Garnett February 14, 2023 at 8:26 PM
Same issue with vendor option for Rules:
Example:
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" version="1.0.0">
<sld:NamedLayer>
<sld:Name>ne:countries</sld:Name>
<sld:UserStyle>
<sld:Name>countries_mapcolor9</sld:Name>
<sld:Title>Countries Mapcolor9</sld:Title>
<sld:Abstract>Theme using mapcolor9 for ne:countries layer.</sld:Abstract>
<sld:FeatureTypeStyle>
<sld:Rule>
<sld:Name>Countries</sld:Name>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name="fill">#8DD3C7</sld:CssParameter>
</sld:Fill>
</sld:PolygonSymbolizer>
<sld:VendorOption name="inclusion">legendOnly</sld:VendorOption>
</sld:Rule>
Jody Garnett February 14, 2023 at 8:06 PM
Checking XSD: https://github.com/geotools/geotools/blob/main/modules/extension/xsd/xsd-sld/src/main/resources/org/geotools/sld/bindings/StyledLayerDescriptor.xsd
It looks okay; not sure what is wrong:
<xsd:element name="PointSymbolizer" substitutionGroup="sld:Symbolizer">
<xsd:annotation>
<xsd:documentation>
A "PointSymbolizer" specifies the rendering of a "graphic symbol"
at a point.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="sld:SymbolizerType">
<xsd:sequence>
<xsd:element ref="sld:Geometry" minOccurs="0"/>
<xsd:element ref="sld:Graphic" minOccurs="0"/>
<xsd:element ref="sld:VendorOption" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
Jody Garnett February 14, 2023 at 8:05 PM
Okay that was part of it, thanks!
The other common error is any vendor options for point symbolizer….
https://docs.geoserver.org/2.22.x/en/user/styling/sld/extensions/label-obstacles.html
https://docs.geoserver.geo-solutions.it/edu/en/pretty_maps/style_points.html
Steps to reproduce:
Generate a point symbolizer
Add
labelObstacle
example as described in the manualValidation error:
line 24: cvc-complex-type.2.4.d: Invalid content was found starting with element 'VendorOption'. No child element is expected at this point.
Here is the resulting file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>check</Name>
<UserStyle>
<Title>dark yellow square point style</Title>
<FeatureTypeStyle>
<Rule>
<Title>dark yellow point</Title>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#99cc00</CssParameter>
</Fill>
</Mark>
<Size>6</Size>
</Graphic>
<VendorOption name="labelObstacle">true</VendorOption>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Jukka Rahkonen February 14, 2023 at 6:59 PM
I had an experiment with pull requests. I put only one sld in each. Have a look and take them or not. At least they validate locally and the layer preview still shows the layers.
None of the “ne” styles that come with GS 2.22.1 can be validated with the style editor. For example style “boundary_lines” gives an error
line 24: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.opengis.net/sld":MinScaleDenominator}'. One of '{"http://www.opengis.net/sld":Symbolizer}' is expected. line 36: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.opengis.net/sld":MinScaleDenominator}'. One of '{"http://www.opengis.net/sld":Symbolizer}' is expected.