0

I have a SLD (version 1.1.0) on GeoServer (version 2.24.2)

    <?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:se="http://www.opengis.net/se" xmlns:ogc="http://www.opengis.net/ogc" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:xlink="http://www.w3.org/1999/xlink">
  <NamedLayer>
    <se:Name>LL Message</se:Name>
    <UserStyle>
      <se:Name>LL Message</se:Name>
      <se:FeatureTypeStyle>
....

When I dowload it through the REST I've got 1.0.0 version of SLD

  <?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns="http://www.opengis.net/sld" version="1.0.0">
  <sld:NamedLayer>
    <sld:Name>LL Message</sld:Name>
    <sld:UserStyle>
      <sld:Name>LL Message</sld:Name>
      <sld:FeatureTypeStyle>
        <sld:Name>name</sld:Name>
.....

Why is SLD 1.1.0 converted to SLD 1.0.0. during download and how to avoid that? I would like to use SLD 1.1.0 as template, therefore I need it as it is originally stored.

1 Answer 1

2

You need to specify the content-type of your file to be SLD 1.1 (application/vnd.ogc.se+xml) when you upload it, as described in the REST API Documents:

Use POST with a style file (application/vnd.ogc.sld+xml or application/vnd.ogc.se+xml for SLD; additional style types are added by extensions) to generate a style info and upload the style all at once. Then separately PUT the style info at /styles/{style} to make any desired changes to the generated catalog entry. You can also use POST with a ZIP file to upload a SLD 1.0 (application/vnd.ogc.sld+xml) file and any associated icon files, and then separately PUT the style info at /styles/{style}. POST with a ZIP file does not support any other style types.

3
  • Do you answer the right question? OP writes "When I dowload it through the REST I've got 1.0.0 version of SLD"
    – user30184
    Commented May 29 at 8:59
  • but the problem is that it got downgraded when they uploaded it, I think, they may also need to specify the correct mime type for the download
    – Ian Turton
    Commented May 29 at 9:01
  • Ian, I have made the template from scratch inside GeoServer GUI. Therefore there is a 1.1.0 version of SLD, but I didn't know that even through GET (REST) I have to define mime type. BTW, download through browser is also downgrading version od SLD to 1.0.0.
    – JA_LL
    Commented May 29 at 11:01

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.