0

GeoServer (2.14.3) gives me the following error:

line 29: cvc-complex-type.2.4.a: Invalid content was found starting with element 'se:Stroke'. One of '{"http://www.opengis.net/se":VendorOption}' is expected.

when trying to import the following (SLD) style (created with QGIS):

<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:se="http://www.opengis.net/se">
 <NamedLayer>
  <se:Name>Arsinoes-geopackage-vectors Structures</se:Name>
  <UserStyle>
   <se:Name>Arsinoes-geopackage-vectors Structures</se:Name>
   <se:FeatureTypeStyle>
    <se:Rule>
     <se:Name>Graben/fissure</se:Name>
     <se:Description>
      <se:Title>Graben/fissure</se:Title>
     </se:Description>
     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:PropertyIsEqualTo>
       <ogc:PropertyName>Structure</ogc:PropertyName>
       <ogc:Literal>graben/fissure</ogc:Literal>
      </ogc:PropertyIsEqualTo>
     </ogc:Filter>
     <se:LineSymbolizer>
      <se:Stroke>
       <se:SvgParameter name="stroke">#232323</se:SvgParameter>
       <se:SvgParameter name="stroke-width">1</se:SvgParameter>
       <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
       <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
      </se:Stroke>
     </se:LineSymbolizer>
     <se:LineSymbolizer>
      <se:VendorOption name="placement">centralPoint</se:VendorOption>
      <se:Stroke>
       <se:GraphicStroke>
        <se:Graphic>
         <se:Mark>
          <se:WellKnownName>circle</se:WellKnownName>
          <se:Fill>
           <se:SvgParameter name="fill">#000000</se:SvgParameter>
          </se:Fill>
          <se:Stroke>
           <se:SvgParameter name="stroke">#232323</se:SvgParameter>
           <se:SvgParameter name="stroke-width">0.5</se:SvgParameter>
          </se:Stroke>
         </se:Mark>
         <se:Size>5</se:Size>
        </se:Graphic>
       </se:GraphicStroke>
      </se:Stroke>
     </se:LineSymbolizer>
    </se:Rule>
    <se:Rule>
     <se:Name>Wrinkle ridge</se:Name>
     <se:Description>
      <se:Title>Wrinkle ridge</se:Title>
     </se:Description>
     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:PropertyIsEqualTo>
       <ogc:PropertyName>Structure</ogc:PropertyName>
       <ogc:Literal>wrinkle ridge</ogc:Literal>
      </ogc:PropertyIsEqualTo>
     </ogc:Filter>
     <se:LineSymbolizer>
      <se:Stroke>
       <se:SvgParameter name="stroke">#ff00ff</se:SvgParameter>
       <se:SvgParameter name="stroke-width">1</se:SvgParameter>
       <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
       <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
      </se:Stroke>
     </se:LineSymbolizer>
    </se:Rule>
    <se:Rule>
     <se:Name>Crater rim</se:Name>
     <se:Description>
      <se:Title>Crater rim</se:Title>
     </se:Description>
     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
      <ogc:PropertyIsEqualTo>
       <ogc:PropertyName>Structure</ogc:PropertyName>
       <ogc:Literal>Crater rim</ogc:Literal>
      </ogc:PropertyIsEqualTo>
     </ogc:Filter>
     <se:LineSymbolizer>
      <se:Stroke>
       <se:SvgParameter name="stroke">#000000</se:SvgParameter>
       <se:SvgParameter name="stroke-width">0.5</se:SvgParameter>
       <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
       <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
      </se:Stroke>
     </se:LineSymbolizer>
     <se:LineSymbolizer>
      <se:Stroke>
       <se:GraphicStroke>
        <se:Graphic>
         <se:Mark>
          <se:WellKnownName>line</se:WellKnownName>
          <se:Fill>
           <se:SvgParameter name="fill">#ff0000</se:SvgParameter>
          </se:Fill>
          <se:Stroke>
           <se:SvgParameter name="stroke">#232323</se:SvgParameter>
           <se:SvgParameter name="stroke-width">1</se:SvgParameter>
          </se:Stroke>
         </se:Mark>
         <se:Size>3</se:Size>
        </se:Graphic>
        <se:Gap>
         <ogc:Literal>18</ogc:Literal>
        </se:Gap>
       </se:GraphicStroke>
      </se:Stroke>
     </se:LineSymbolizer>
     <se:LineSymbolizer>
      <se:Stroke>
       <se:GraphicStroke>
        <se:Graphic>
         <se:Mark>
          <se:WellKnownName>line</se:WellKnownName>
          <se:Fill>
           <se:SvgParameter name="fill">#ff0000</se:SvgParameter>
          </se:Fill>
          <se:Stroke>
           <se:SvgParameter name="stroke">#232323</se:SvgParameter>
           <se:SvgParameter name="stroke-width">1</se:SvgParameter>
          </se:Stroke>
         </se:Mark>
         <se:Size>3</se:Size>
         <se:Displacement>
          <se:DisplacementX>1</se:DisplacementX>
          <se:DisplacementY>0</se:DisplacementY>
         </se:Displacement>
        </se:Graphic>
        <se:Gap>
         <ogc:Literal>18</ogc:Literal>
        </se:Gap>
       </se:GraphicStroke>
      </se:Stroke>
     </se:LineSymbolizer>
     <se:LineSymbolizer>
      <se:Stroke>
       <se:SvgParameter name="stroke">#232323</se:SvgParameter>
       <se:SvgParameter name="stroke-width">1</se:SvgParameter>
       <se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
       <se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
      </se:Stroke>
     </se:LineSymbolizer>
    </se:Rule>
   </se:FeatureTypeStyle>
  </UserStyle>
 </NamedLayer>
</StyledLayerDescriptor>

It doesn't make sense to me, though, since Stroke is being defined at http://www.opengis.net/se (redirected to http://schemas.opengis.net/se/1.1.0/Symbolizer.xsd).

I saw the answers at

Any help is greatly appreciated.

3

Order is important in SLD (and XML in general) - the SE specification requires that VendorOptions come at the end of the Symbolizer they are in, so the error is actually saying - "You have started with VendorOptions so you can't go onto Strokes!".

GeoServer is lenient when it comes to processing SLD files so this file will work but it is invalid as the validate process says. If you want it to be valid move the VendorOption line below the Stroke block. If you want to avoid having to do it again raise an issue with the QGIS team.

| improve this answer | |
  • And... he strikes again! Thanks, Ian, I would never have guessed this one. You say "SE specification requires that VendorOptions come at the end of the Symbolizer they are in", where do I find such specification? – Brandt Jun 16 at 10:04
  • 1
    On the OGC site - I've added a link – Ian Turton Jun 16 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.