Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unnecessary nesting breaks mss output #17

Open
gubuntu opened this issue Oct 10, 2014 · 2 comments
Open

unnecessary nesting breaks mss output #17

gubuntu opened this issue Oct 10, 2014 · 2 comments

Comments

@gubuntu
Copy link

gubuntu commented Oct 10, 2014

In each of these elements one set of braces is redundant and makes the document invalid.

    #cleantopo {
        .raster {
            {
            }
        }
    }
    #countries {
        .Countries_style {
            {
                polygon-fill: rgb(255, 245, 229);
                line-color: rgb(107, 107, 107);
                line-width: 1.16;
            }
        }
    }

In a stylesheet with thousands of lines this is difficult to clean up when there are some styles like this where a filter expression makes the extra set of braces required.

    #freeway10mil {
        .Freeway10million_style_label {
            [([country]!='South Africa')] {
                shield-name: "";
                shield-face-name: "DejaVu Sans Bold";
                shield-size: 7;
                shield-min-distance: 30.0;
                shield-spacing: 750;
                shield-file: "shield2_test.svg";
            }
        }
    }
@rundel
Copy link
Owner

rundel commented Oct 10, 2014

Do you have a small example xml file that produces the faulty output?

@gubuntu
Copy link
Author

gubuntu commented Oct 11, 2014

"raster" from above:

<Style name="raster" >
        <Rule>
                <RasterSymbolizer scaling="bilinear">
                </RasterSymbolizer>
        </Rule>
  </Style>
  <Layer minzoom="8000000" maxzoom="100000000" name="Cleantopo" status="on" srs="+init=epsg:&srid_raster;" >
        <StyleName>raster</StyleName>
        <Datasource>
                <Parameter name="type">gdal</Parameter>
                <Parameter name="file">cleanafrica_relief.tif</Parameter>
                <Parameter name="format">tiff</Parameter>
        </Datasource>
</Layer>

"countries" from above:

<Style name="Countries_style">
    <Rule>
      <PolygonSymbolizer fill="rgb(255,245,229)"/>
      <LineSymbolizer stroke="rgb(107,107,107)" stroke-width="1.16"/>
    </Rule>
   </Style>
  <Layer maxzoom="60000" name="Countries" srs="+init=epsg:&srid;">
    <StyleName>Countries_style</StyleName>
    <Datasource>
      <Parameter name="dbname">&dbname;</Parameter>
      <Parameter name="estimate_extent">0</Parameter>
      <Parameter name="extent">&extent;</Parameter>
      <Parameter name="geometry_field">&geometry_field;</Parameter>
      <Parameter name="host">&host;</Parameter>
      <Parameter name="password">&password;</Parameter>
      <Parameter name="port">&port;</Parameter>
      <Parameter name="srid">&srid;</Parameter>
      <Parameter name="table">a_countries</Parameter>
      <Parameter name="type">&datasourcetype;</Parameter>
      <Parameter name="user">&password;</Parameter>
    </Datasource>
  </Layer>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants