I have created my SLD's in QGIS and want to use them in Geoserver. I have imported and validated them without any problems
but when I try to view the data using Layer Preview --> OpenLayers-->Go it tries to download the data rather than let me view it. With the default symbology it works fine.
Is there something fundamental that I have to change in the SLD from Geoserver for it to work?
One of the simple and 2 complex SLD's are below (roads at different zoom levels)
Roads - Simple
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
<NamedLayer>
<se:Name>Roads_GHD_20121121</se:Name>
<UserStyle>
<se:Name>Roads_GHD_20121121</se:Name>
<se:FeatureTypeStyle>
<se:Rule>
<se:Name>GHD Roads</se:Name>
<se:MaxScaleDenominator>250000</se:MaxScaleDenominator>
<se:LineSymbolizer>
<se:Stroke>
<se:SvgParameter name="stroke">#ff0000</se:SvgParameter>
<se:SvgParameter name="stroke-width">0.4</se:SvgParameter>
<se:SvgParameter name="stroke-linejoin">bevel</se:SvgParameter>
<se:SvgParameter name="stroke-linecap">square</se:SvgParameter>
<se:SvgParameter name="stroke-dasharray">5 2</se:SvgParameter>
</se:Stroke>
</se:LineSymbolizer>
</se:Rule>
</se:FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Roads - Complex
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld 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>Road with border</Name>
<UserStyle>
<Title>Road with border</Title>
<!-- Local Roads -->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>0</MinScaleDenominator>
<MaxScaleDenominator>1787</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#CDAA66</CssParameter>
<CssParameter name="stroke-width">12</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>0</MinScaleDenominator>
<MaxScaleDenominator>1787</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FFFFFF</CssParameter>
<CssParameter name="stroke-width">11</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>road_name2</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<LabelPlacement>
<LinePlacement/>
</LabelPlacement>
<Halo>
<Radius>
<ogc:Literal>1</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFFFF</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>1</ogc:Literal>
</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="followLine">true</VendorOption>
<VendorOption name="maxAngleDelta">30</VendorOption>
<VendorOption name="maxDisplacement">800</VendorOption>
<VendorOption name="repeat">1000</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
<!-- Local Roads 1787 - 3573-->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>1787</MinScaleDenominator>
<MaxScaleDenominator>3573</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#CDAA66</CssParameter>
<CssParameter name="stroke-width">7</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>1787</MinScaleDenominator>
<MaxScaleDenominator>3573</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FFFFFF</CssParameter>
<CssParameter name="stroke-width">6</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>road_name2</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<LabelPlacement>
<LinePlacement/>
</LabelPlacement>
<Halo>
<Radius>
<ogc:Literal>1</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFFFF</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>1</ogc:Literal>
</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="followLine">true</VendorOption>
<VendorOption name="maxAngleDelta">30</VendorOption>
<VendorOption name="maxDisplacement">800</VendorOption>
<VendorOption name="repeat">1000</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
<!-- Local Roads 3573 - 28573-->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>3573</MinScaleDenominator>
<MaxScaleDenominator>28573</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#CDAA66</CssParameter>
<CssParameter name="stroke-width">4</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
Points Complex with SVG files.
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>3573</MinScaleDenominator>
<MaxScaleDenominator>28573</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FFFFFF</CssParameter>
<CssParameter name="stroke-width">3</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>road_name2</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<LabelPlacement>
<LinePlacement/>
</LabelPlacement>
<Halo>
<Radius>
<ogc:Literal>1</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFFFF</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>1</ogc:Literal>
</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="followLine">true</VendorOption>
<VendorOption name="maxAngleDelta">30</VendorOption>
<VendorOption name="maxDisplacement">800</VendorOption>
<VendorOption name="repeat">1000</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
<!-- Local Roads 28573 - 114287 -->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>Y</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>28573</MinScaleDenominator>
<MaxScaleDenominator>114287</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#D7C29E</CssParameter>
<CssParameter name="stroke-width">1</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<!-- State Roads - 0 - 1787 -->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>state</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>0</MinScaleDenominator>
<MaxScaleDenominator>1787</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#CDAA66</CssParameter>
<CssParameter name="stroke-width">13</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>state</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>0</MinScaleDenominator>
<MaxScaleDenominator>1787</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FFFF00</CssParameter>
<CssParameter name="stroke-width">12</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>road_name2</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<LabelPlacement>
<LinePlacement/>
</LabelPlacement>
<Halo>
<Radius>
<ogc:Literal>1</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFF00</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>1</ogc:Literal>
</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="followLine">true</VendorOption>
<VendorOption name="maxAngleDelta">30</VendorOption>
<VendorOption name="maxDisplacement">800</VendorOption>
<VendorOption name="repeat">1000</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
<!-- State Roads - 1787 - 3572 -->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>state</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>1787</MinScaleDenominator>
<MaxScaleDenominator>3573</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#CDAA66</CssParameter>
<CssParameter name="stroke-width">7</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>state</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>1787</MinScaleDenominator>
<MaxScaleDenominator>3573</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FFFF00</CssParameter>
<CssParameter name="stroke-width">6</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>road_name2</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<LabelPlacement>
<LinePlacement/>
</LabelPlacement>
<Halo>
<Radius>
<ogc:Literal>1</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFF00</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>1</ogc:Literal>
</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="followLine">true</VendorOption>
<VendorOption name="maxAngleDelta">30</VendorOption>
<VendorOption name="maxDisplacement">800</VendorOption>
<VendorOption name="repeat">1000</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
<!-- State Roads - 3572 - infinity -->
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>state</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>3573</MinScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#CDAA66</CssParameter>
<CssParameter name="stroke-width">5</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<Rule>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>State_cont</ogc:PropertyName>
<ogc:Literal>state</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<MinScaleDenominator>3573</MinScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#FFFF00</CssParameter>
<CssParameter name="stroke-width">4</CssParameter>
<CssParameter name="stroke-linecap">round</CssParameter>
</Stroke>
</LineSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>road_name2</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">10</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
</Font>
<LabelPlacement>
<LinePlacement/>
</LabelPlacement>
<Halo>
<Radius>
<ogc:Literal>1</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFF00</ogc:Literal>
</CssParameter>
<CssParameter name="fill-opacity">
<ogc:Literal>1</ogc:Literal>
</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="followLine">true</VendorOption>
<VendorOption name="maxAngleDelta">30</VendorOption>
<VendorOption name="maxDisplacement">800</VendorOption>
<VendorOption name="repeat">1000</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>