Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#731 closed defect (fixed)

You can't put a comment between two <Rule> definition in SLD

Reported by: jdenisgiguere@… Owned by: assefa
Priority: high Milestone:
Component: WMS Server Version: 4.2
Severity: normal Keywords:
Cc:

Description

If you put a comment between two Rules of the same layer, no more rule are
parsed in this layer.

In this exemple, remove comment to get the Rule with the ElseFilter

<?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>routes</Name>
        <UserStyle>
            <Title>Publisher</Title>
            <FeatureTypeStyle>
                <Rule>
                    <ogc:Filter>
                        <ogc:PropertyIsEqualTo>
                            <ogc:PropertyName>EN</ogc:PropertyName> 
                            <ogc:Literal>Highway</ogc:Literal>
                        </ogc:PropertyIsEqualTo>
                    </ogc:Filter>
                    <LineSymbolizer>
                        <Geometry>
                            <ogc:PropertyName>center-line</ogc:PropertyName>
                        </Geometry> 
                        <Stroke>
                            <CssParameter name="stroke">#ff0000</CssParameter>
                            <CssParameter name="stroke-width">2.0</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
                <!-- This comment disable all the following rules -->
                <Rule>
                <!-- This comment is okay -->
                	<ElseFilter/>
                	<LineSymbolizer>
                        <Geometry>
                            <ogc:PropertyName>center-line</ogc:PropertyName>
                        </Geometry>
                        <Stroke>
                            <CssParameter name="stroke">#000000</CssParameter>
                            <CssParameter name="stroke-width">1.0</CssParameter>
                        </Stroke>
                    </LineSymbolizer>
                </Rule>
            </FeatureTypeStyle>
        </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>


Note about this XML

Schema validating with XSV 2.7-1 of 2004/04/01 13:40:50

    * Target: file:///usr/local/XSV/xsvlog/@5477.1uploaded
         (Real name: routes-bug.xml)
    * docElt: {http://www.opengis.net/sld}StyledLayerDescriptor
    * Validation was strict, starting with type [Anonymous]
    * schemaLocs: http://www.opengis.net/sld ->
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd
    * The schema(s) used for schema-validation had
        no errors
    * No schema-validity problems were found in the target

Change History (3)

comment:1 by assefa, 20 years ago

Owner: changed from mapserverbugs to assefa
looking into it.

comment:2 by assefa, 20 years ago

Resolution: fixed
Status: newclosed
Corrected and availabe trough CVS in mapogcsld revision 1.30.

Jean-Denis, please do the cheking and close the bug if things work.

comment:3 by jdenisgiguere@…, 20 years ago

It works.
Thank you ! 
Note: See TracTickets for help on using tickets.